Skip to content

Commit

Permalink
build: try removing more hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
G4Vi committed Dec 4, 2023
1 parent c0d6cb9 commit c3fa0b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
mkdir build
cd build
cmake ..
stat /usr/local/include/json/json.h || true
stat /usr/local/include/jsoncpp/json/json.h || true
stat /opt/homebrew/include/json/json.h || true
stat /opt/homebrew/include/jsoncpp/json/json.h || true
make
LD_LIBRARY_PATH=/usr/local/lib make test
LD_LIBRARY_PATH=/usr/local/lib ./example ../wasm/code-functions.wasm
make test
./example ../wasm/code-functions.wasm
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ add_executable(
extism-test
test/test.cpp
)
target_link_directories(extism-test PUBLIC ${CURRENT_BINARY_DIR})
#target_link_directories(extism-test PUBLIC ${CURRENT_BINARY_DIR})
target_link_libraries(
extism-test
GTest::gtest
Expand Down
19 changes: 9 additions & 10 deletions cmake/Findjsoncpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ find_path(jsoncpp_INCLUDE_DIR
NAMES json/json.h
PATHS ${PC_jsoncpp_INCLUDE_DIRS}
)
message(WARNING "jsoncpp_INCLUDE_DIR ${jsoncpp_INCLUDE_DIR}")
find_library(jsoncpp_LIBRARY
NAMES jsoncpp
PATHS ${PC_jsoncpp_LIBRARY_DIRS}
Expand Down Expand Up @@ -37,17 +36,17 @@ if(jsoncpp_FOUND AND NOT TARGET jsoncpp_lib)
INTERFACE_INCLUDE_DIRECTORIES "${jsoncpp_INCLUDE_DIR}"
)
endif()

if(NOT ${jsoncpp_STATIC_LIBRARY} STREQUAL "jsoncpp_STATIC_LIBRARY-NOTFOUND")
if(jsoncpp_FOUND AND NOT TARGET jsoncpp_static)
add_library(jsoncpp_static UNKNOWN IMPORTED)
set_target_properties(jsoncpp_static PROPERTIES
IMPORTED_LOCATION "${jsoncpp_STATIC_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_jsoncpp_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${jsoncpp_INCLUDE_DIR}"
)
endif()
if(jsoncpp_FOUND AND NOT TARGET jsoncpp_static)
add_library(jsoncpp_static UNKNOWN IMPORTED)
set_target_properties(jsoncpp_static PROPERTIES
IMPORTED_LOCATION "${jsoncpp_STATIC_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_jsoncpp_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${jsoncpp_INCLUDE_DIR}"
)
endif()
endif()

mark_as_advanced(
jsoncpp_INCLUDE_DIR
jsoncpp_LIBRARY
Expand Down

0 comments on commit c3fa0b8

Please sign in to comment.