forked from bytecodealliance/wasmtime-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
28 lines (23 loc) · 890 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
project(Wasmtime VERSION 0.27.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
option(ENABLE_CODE_ANALYSIS "Run code analysis" OFF)
message(STATUS "ENABLE_CODE_ANALYSIS ${ENABLE_CODE_ANALYSIS}")
function(configure_wasmtime_target name)
if (MSVC)
target_compile_options(${name} PUBLIC /DWASM_API_EXTERN= /DWASI_API_EXTERN=)
target_link_libraries(${name} ws2_32 bcrypt advapi32 userenv ntdll shell32 ole32)
endif()
target_link_libraries(${name} wasmtime)
if (UNIX)
target_link_libraries(${name} stdc++ pthread)
endif (UNIX)
target_include_directories(${name} PUBLIC
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/c-api/include)
target_link_directories(${name} PUBLIC ${PROJECT_SOURCE_DIR}/c-api/lib)
endfunction()
enable_testing()
add_subdirectory(examples)
add_subdirectory(tests)