dev-lang/wabt: Remove *.wasm blobs from $S

Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
This commit is contained in:
Haelwenn (lanodan) Monnier
2022-10-04 04:23:02 +02:00
parent 612665d524
commit 37e16f64f8
2 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1fe79b8d..5ebf8f87 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -632,52 +632,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 (NOT WIN32)
- # depends on pthreads
- set(THREADS_PREFER_PTHREAD_FLAG ON)
- find_package(Threads REQUIRED)
- c_api_example(threads)
- endif ()
+ add_custom_target(check DEPENDS run-unittests run-tests)
endif ()
# install

View File

@@ -20,12 +20,19 @@ RESTRICT="!test? ( test )"
DEPEND="test? ( dev-cpp/gtest )"
BDEPEND="${PYTHON_DEPS}"
PATCHES=(
# Disable tests depending on third_party/wasm-c-api/example/*.wasm
"${FILESDIR}/wabt-1.0.29-wasm-blob-tests.patch"
)
src_prepare() {
cmake_src_prepare
# Submodules kept: third_party/testsuite third_party/wasm-c-api
rm -r third_party/gtest third_party/ply third_party/uvwasi || die
rm third_party/wasm-c-api/example/*.wasm fuzz-in/wasm/stuff.wasm wasm2c/examples/fac/fac.wasm || die
sed -i 's;default_compiler =.*;default_compiler = os.getenv("CC", "cc");' test/run-spec-wasm2c.py || die
}