Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1e2799f

Browse files
authored
feat: enable intree builds, just clone with submodules and configure with -DEXTISM_CPP_BUILD_IN_TREE=1 (#7)
* feat: enable intree builds, just clone with submodules and configure with -DEXTISM_CPP_BUILD_IN_TREE=1* fix: installing shared in-tree build with libextism update
1 parent8961b9f commit1e2799f

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

‎.gitmodules‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "submodules/extism"]
2+
path=submodules/extism
3+
url=https://github.com/extism/extism.git
4+
[submodule "submodules/jsoncpp"]
5+
path=submodules/jsoncpp
6+
url=https://github.com/open-source-parsers/jsoncpp

‎CMakeLists.txt‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@ link_directories(/opt/homebrew/lib)
99
project(extism-cppVERSION 1.0.0 DESCRIPTION"C++ bindings for libextism")
1010
set(extism-cpp-srcs src/manifest.cpp src/current_plugin.cpp src/plugin.cpp src/function.cpp src/extism.cpp)
1111

12+
option(EXTISM_CPP_BUILD_IN_TREE"Set to ON to build with submodule deps"OFF)
13+
if(EXTISM_CPP_BUILD_IN_TREE)
14+
add_subdirectory(submodules/extism/libextism)
15+
add_subdirectory(submodules/jsoncpp)
16+
endif()
17+
1218
# SHARED
1319
add_library(extism-cpp SHARED ${extism-cpp-srcs})
1420
set_target_properties(extism-cpp PROPERTIESVERSION${PROJECT_VERSION})
1521
set_target_properties(extism-cpp PROPERTIESPUBLIC_HEADER src/extism.hpp)
1622
target_include_directories(extism-cppPUBLIC src)
17-
target_link_libraries(extism-cppPUBLIC extism jsoncpp)
23+
if(EXTISM_CPP_BUILD_IN_TREE)
24+
target_link_libraries(extism-cppPUBLIC extism-shared jsoncpp)
25+
else()
26+
target_link_libraries(extism-cppPUBLIC extism jsoncpp)
27+
endif()
1828
set_target_properties(extism-cpp
1929
PROPERTIESNO_SONAME 1
2030
)
@@ -26,7 +36,11 @@ set_target_properties(extism-cpp-static PROPERTIES OUTPUT_NAME extism-cpp)
2636
set_target_properties(extism-cpp-static PROPERTIESVERSION${PROJECT_VERSION})
2737
set_target_properties(extism-cpp-static PROPERTIESPUBLIC_HEADER src/extism.hpp)
2838
target_include_directories(extism-cpp-staticPUBLIC src)
29-
target_link_libraries(extism-cpp-staticPUBLIC libextism.a jsoncpp)
39+
if(EXTISM_CPP_BUILD_IN_TREE)
40+
target_link_libraries(extism-cpp-staticPUBLIC extism-static jsoncpp_static)
41+
else()
42+
target_link_libraries(extism-cpp-staticPUBLIC libextism.a jsoncpp)
43+
endif()
3044
configure_file(extism-cpp-static.pc.in extism-cpp-static.pc @ONLY)
3145

3246
include(GNUInstallDirs)

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,13 @@ $ pkg-config --libs extism-cpp
6363
```shell
6464
$ pkg-config --static --libs extism-cpp-static
6565
```
66+
67+
##In-Tree builds
68+
69+
If you wish, instead of using installed deps, you can do an in-tree build:
70+
71+
```shell
72+
git clone --recurse-submodules -j4 https://github.com/extism/cpp-sdk.git
73+
cd cpp-sdk
74+
cmake -DEXTISM_CPP_BUILD_IN_TREE=1 -B build&& cmake --build build
75+
```

‎submodules/extism‎

Submoduleextism added at7636c87

‎submodules/jsoncpp‎

Submodulejsoncpp added at69098a1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp