| 1 |
cmake_minimum_required(VERSION 3.10) |
| 2 |
project(wasm-tools-examples) |
| 3 |
|
| 4 |
add_library(wasm-tools-examples STATIC |
| 5 |
wasm-smith.c |
| 6 |
) |
| 7 |
|
| 8 |
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../crates/c-api ${CMAKE_CURRENT_BINARY_DIR}/wasm-tools) |
| 9 |
|
| 10 |
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
| 11 |
target_compile_options(wasm-tools-examples PRIVATE -Wall -Wextra -Wno-deprecated-declarations) |
| 12 |
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") |
| 13 |
target_compile_options(wasm-tools-examples PRIVATE /W4) |
| 14 |
endif() |
| 15 |
|
| 16 |
set_target_properties(wasm-tools-examples PROPERTIES |
| 17 |
OUTPUT_NAME "examples" |
| 18 |
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
| 19 |
CXX_VISIBILITY_PRESET hidden |
| 20 |
POSITION_INDEPENDENT_CODE ON) |
| 21 |
|
| 22 |
target_include_directories(wasm-tools-examples PUBLIC wasm-tools) |
| 23 |
target_link_libraries(wasm-tools-examples PUBLIC wasm-tools) |