forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
28 lines (24 loc) · 1.04 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
include(GoogleTest)
function(add_capi_test name path)
add_executable(test-${name} ${path})
target_link_libraries(test-${name} PRIVATE wasmtime-cpp gtest_main)
gtest_discover_tests(test-${name})
endfunction()
add_capi_test(simple simple.cc)
add_capi_test(types types.cc)
add_capi_test(func func.cc)
add_capi_test(component-instantiate component/instantiate.cc)
# Add a custom test where two files include `wasmtime.hh` and are compiled into
# the same executable (basically makes sure any defined functions in the header
# are tagged with `inline`).
add_executable(test-double-include double-include-a.cc double-include-b.cc)
target_link_libraries(test-double-include PRIVATE wasmtime-cpp gtest_main)
gtest_discover_tests(test-double-include)