2019-02-02 04:10:36 +00:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2019-03-06 11:03:38 +00:00
|
|
|
project (WasmerRuntimeCApiTests)
|
2019-02-02 04:10:36 +00:00
|
|
|
|
2019-03-27 09:49:28 +00:00
|
|
|
add_executable(test-exported-memory test-exported-memory.c)
|
2019-02-14 02:02:11 +00:00
|
|
|
add_executable(test-exports test-exports.c)
|
2019-02-09 23:39:15 +00:00
|
|
|
add_executable(test-globals test-globals.c)
|
2019-02-02 23:43:59 +00:00
|
|
|
add_executable(test-import-function test-import-function.c)
|
2019-03-15 10:52:34 +00:00
|
|
|
add_executable(test-imports test-imports.c)
|
|
|
|
add_executable(test-instantiate test-instantiate.c)
|
2019-02-05 03:46:47 +00:00
|
|
|
add_executable(test-memory test-memory.c)
|
2019-02-16 01:47:00 +00:00
|
|
|
add_executable(test-module test-module.c)
|
2019-02-23 21:41:38 +00:00
|
|
|
add_executable(test-module-exports test-module-exports.c)
|
2019-03-15 10:52:34 +00:00
|
|
|
add_executable(test-module-imports test-module-imports.c)
|
2019-03-15 10:53:24 +00:00
|
|
|
add_executable(test-module-serialize test-module-serialize.c)
|
2019-02-09 19:37:07 +00:00
|
|
|
add_executable(test-tables test-tables.c)
|
2019-03-15 10:52:34 +00:00
|
|
|
add_executable(test-validate test-validate.c)
|
2019-02-02 04:10:36 +00:00
|
|
|
|
2019-02-03 18:14:14 +00:00
|
|
|
find_library(
|
|
|
|
WASMER_LIB NAMES libwasmer_runtime_c_api.dylib libwasmer_runtime_c_api.so libwasmer_runtime_c_api.dll
|
2019-07-06 02:55:03 +00:00
|
|
|
PATHS ${CMAKE_SOURCE_DIR}/../../../target/release/
|
2019-02-03 18:14:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if(NOT WASMER_LIB)
|
|
|
|
message(FATAL_ERROR "wasmer library not found")
|
|
|
|
endif()
|
2019-02-02 04:10:36 +00:00
|
|
|
|
|
|
|
enable_testing()
|
2019-03-06 11:03:38 +00:00
|
|
|
|
|
|
|
set(
|
|
|
|
COMPILER_OPTIONS
|
|
|
|
# Clang or gcc
|
|
|
|
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:
|
|
|
|
"-Werror" >
|
|
|
|
# MSVC
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:
|
|
|
|
"/WX" >
|
|
|
|
)
|
|
|
|
|
2019-03-27 09:49:28 +00:00
|
|
|
target_link_libraries(test-exported-memory general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-exported-memory PRIVATE ${COMPILER_OPTIONS})
|
|
|
|
add_test(test-exported-memory test-exported-memory)
|
|
|
|
|
2019-03-06 11:03:38 +00:00
|
|
|
target_link_libraries(test-exports general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-exports PRIVATE ${COMPILER_OPTIONS})
|
2019-02-14 02:02:11 +00:00
|
|
|
add_test(test-exports test-exports)
|
2019-03-06 11:03:38 +00:00
|
|
|
|
|
|
|
target_link_libraries(test-globals general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-globals PRIVATE ${COMPILER_OPTIONS})
|
2019-02-09 23:39:15 +00:00
|
|
|
add_test(test-globals test-globals)
|
2019-03-06 11:03:38 +00:00
|
|
|
|
|
|
|
target_link_libraries(test-import-function general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-import-function PRIVATE ${COMPILER_OPTIONS})
|
2019-02-02 23:43:59 +00:00
|
|
|
add_test(test-import-function test-import-function)
|
2019-03-06 11:03:38 +00:00
|
|
|
|
2019-03-15 10:52:34 +00:00
|
|
|
target_link_libraries(test-imports general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-imports PRIVATE ${COMPILER_OPTIONS})
|
|
|
|
add_test(test-imports test-imports)
|
|
|
|
|
|
|
|
target_link_libraries(test-instantiate general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-instantiate PRIVATE ${COMPILER_OPTIONS})
|
|
|
|
add_test(test-instantiate test-instantiate)
|
|
|
|
|
2019-03-06 11:03:38 +00:00
|
|
|
target_link_libraries(test-memory general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-memory PRIVATE ${COMPILER_OPTIONS})
|
2019-02-05 03:46:47 +00:00
|
|
|
add_test(test-memory test-memory)
|
2019-03-06 11:03:38 +00:00
|
|
|
|
|
|
|
target_link_libraries(test-module general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-module PRIVATE ${COMPILER_OPTIONS})
|
2019-02-16 01:47:00 +00:00
|
|
|
add_test(test-module test-module)
|
2019-03-06 11:03:38 +00:00
|
|
|
|
|
|
|
target_link_libraries(test-module-exports general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-module-exports PRIVATE ${COMPILER_OPTIONS})
|
2019-02-23 21:41:38 +00:00
|
|
|
add_test(test-module-exports test-module-exports)
|
2019-03-06 11:03:38 +00:00
|
|
|
|
2019-03-15 10:52:34 +00:00
|
|
|
target_link_libraries(test-module-imports general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-module-imports PRIVATE ${COMPILER_OPTIONS})
|
|
|
|
add_test(test-module-imports test-module-imports)
|
2019-02-02 04:10:36 +00:00
|
|
|
|
2019-03-15 10:53:24 +00:00
|
|
|
target_link_libraries(test-module-serialize general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-module-serialize PRIVATE ${COMPILER_OPTIONS})
|
|
|
|
add_test(test-module-serialize test-module-serialize)
|
|
|
|
|
2019-03-06 11:03:38 +00:00
|
|
|
target_link_libraries(test-tables general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-tables PRIVATE ${COMPILER_OPTIONS})
|
|
|
|
add_test(test-tables test-tables)
|
2019-03-15 10:52:34 +00:00
|
|
|
|
|
|
|
target_link_libraries(test-validate general ${WASMER_LIB})
|
|
|
|
target_compile_options(test-validate PRIVATE ${COMPILER_OPTIONS})
|
|
|
|
add_test(test-validate test-validate)
|