mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 13:11:32 +00:00
Configure cmake to find dylib/so/dll wasmer library
This commit is contained in:
@ -4,11 +4,19 @@ project (WasmerCApiTests)
|
|||||||
add_executable(test-instantiate test-instantiate.c)
|
add_executable(test-instantiate test-instantiate.c)
|
||||||
add_executable(test-import-function test-import-function.c)
|
add_executable(test-import-function test-import-function.c)
|
||||||
|
|
||||||
target_link_libraries(test-instantiate
|
find_library(
|
||||||
general "${CMAKE_SOURCE_DIR}/../../../target/debug/libwasmer_runtime_c_api.dylib")
|
WASMER_LIB NAMES libwasmer_runtime_c_api.dylib libwasmer_runtime_c_api.so libwasmer_runtime_c_api.dll
|
||||||
|
PATHS ${CMAKE_SOURCE_DIR}/../../../target/debug/
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT WASMER_LIB)
|
||||||
|
message(FATAL_ERROR "wasmer library not found")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(test-instantiate
|
||||||
|
general ${WASMER_LIB})
|
||||||
target_link_libraries(test-import-function
|
target_link_libraries(test-import-function
|
||||||
general "${CMAKE_SOURCE_DIR}/../../../target/debug/libwasmer_runtime_c_api.dylib")
|
general ${WASMER_LIB})
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_test(test-instantiate test-instantiate)
|
add_test(test-instantiate test-instantiate)
|
||||||
|
Reference in New Issue
Block a user