mirror of
https://github.com/gentoo-mirror/guru.git
synced 2025-04-21 07:52:21 -04:00
56 lines
1.9 KiB
Diff
56 lines
1.9 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 2935e9e5..949e4e38 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -658,49 +658,7 @@ if (BUILD_TESTS)
|
|
USES_TERMINAL
|
|
)
|
|
|
|
- add_custom_target(run-c-api-tests
|
|
- COMMAND ${PYTHON_EXECUTABLE} ${WABT_SOURCE_DIR}/test/run-c-api-examples.py --bindir $<TARGET_FILE_DIR:wat2wasm>
|
|
- WORKING_DIRECTORY ${WABT_SOURCE_DIR}
|
|
- USES_TERMINAL
|
|
- )
|
|
-
|
|
- add_custom_target(check DEPENDS run-unittests run-tests run-c-api-tests)
|
|
-
|
|
- function(c_api_example NAME)
|
|
- set(EXENAME wasm-c-api-${NAME})
|
|
- add_executable(${EXENAME} third_party/wasm-c-api/example/${NAME}.c)
|
|
- if (COMPILER_IS_MSVC)
|
|
- set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS "-wd4311")
|
|
- else ()
|
|
- set_target_properties(${EXENAME} PROPERTIES COMPILE_FLAGS "-std=gnu11 -Wno-pointer-to-int-cast")
|
|
- endif ()
|
|
-
|
|
- target_link_libraries(${EXENAME} wasm Threads::Threads)
|
|
- add_custom_target(${EXENAME}-copy-to-bin ALL
|
|
- COMMAND ${CMAKE_COMMAND} -E make_directory ${WABT_SOURCE_DIR}/bin
|
|
- COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${EXENAME}> ${WABT_SOURCE_DIR}/bin/
|
|
- COMMAND ${CMAKE_COMMAND} -E copy ${WABT_SOURCE_DIR}/third_party/wasm-c-api/example/${NAME}.wasm $<TARGET_FILE_DIR:${EXENAME}>/
|
|
- COMMAND ${CMAKE_COMMAND} -E copy ${WABT_SOURCE_DIR}/third_party/wasm-c-api/example/${NAME}.wasm ${WABT_SOURCE_DIR}/bin/
|
|
- DEPENDS ${EXENAME}
|
|
- )
|
|
- add_dependencies(run-c-api-tests ${EXENAME})
|
|
- endfunction()
|
|
-
|
|
- c_api_example(callback)
|
|
- c_api_example(finalize)
|
|
- c_api_example(global)
|
|
- c_api_example(hello)
|
|
- c_api_example(hostref)
|
|
- c_api_example(multi)
|
|
- c_api_example(memory)
|
|
- c_api_example(reflect)
|
|
- c_api_example(serialize)
|
|
- c_api_example(start)
|
|
- c_api_example(table)
|
|
- c_api_example(trap)
|
|
- if (CMAKE_USE_PTHREADS_INIT)
|
|
- c_api_example(threads)
|
|
- endif ()
|
|
+ add_custom_target(check DEPENDS run-unittests run-tests)
|
|
endif ()
|
|
|
|
# install
|