diff options
author | Sam Clegg <sbc@chromium.org> | 2024-01-06 09:06:49 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-06 09:06:49 -0800 |
commit | 82057de7666b84424f8d2bd90e941762e4e14f0e (patch) | |
tree | 7f75d2066ec7e27120c1c7b4c28bf4d131b86ca7 /src | |
parent | c3b2f245fe27b933a97e732b12bdf1eb1a0f39b7 (diff) | |
download | binaryen-82057de7666b84424f8d2bd90e941762e4e14f0e.tar.gz binaryen-82057de7666b84424f8d2bd90e941762e4e14f0e.tar.bz2 binaryen-82057de7666b84424f8d2bd90e941762e4e14f0e.zip |
Fix cmake dependency on wasm-intrinsics.wat (#6206)
I think this is a nicer/better way to do #6204.
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/CMakeLists.txt | 13 | ||||
-rw-r--r-- | src/passes/WasmIntrinsics.cpp.in | 4 |
2 files changed, 5 insertions, 12 deletions
diff --git a/src/passes/CMakeLists.txt b/src/passes/CMakeLists.txt index 182f4a921..9ab9f0247 100644 --- a/src/passes/CMakeLists.txt +++ b/src/passes/CMakeLists.txt @@ -1,19 +1,12 @@ file(READ wasm-intrinsics.wat WASM_INTRINSICS_WAT HEX) +set(CMAKE_CONFIGURE_DEPENDS wasm-intrinsics.wat) string(REGEX MATCHALL "([A-Fa-f0-9][A-Fa-f0-9])" SEPARATED_HEX ${WASM_INTRINSICS_WAT}) -# WASM_INTRINSICS_EMBED_2 and WASM_INTRINSICS_SIZE_2 should be renamed each time -# the content of the wat file changes. This is not strictly necessary, as CMake -# should use the fresh contents each time, but even just re-running CMake -# manually is not enough in practice (one needs to also erase the CMake temp -# files, or use a fresh build dir). Renaming the vars keeps things working -# smoothly for people with existing checkouts. -set(WASM_INTRINSICS_SIZE_2 1) foreach (hex IN LISTS SEPARATED_HEX) - string(APPEND WASM_INTRINSICS_EMBED_2 "0x${hex},") - math(EXPR WASM_INTRINSICS_SIZE_2 "${WASM_INTRINSICS_SIZE_2}+1") + string(APPEND WASM_INTRINSICS_EMBED "0x${hex},") endforeach () -string(APPEND WASM_INTRINSICS_EMBED_2 "0x00") +string(APPEND WASM_INTRINSICS_EMBED "0x00") configure_file(WasmIntrinsics.cpp.in WasmIntrinsics.cpp @ONLY) diff --git a/src/passes/WasmIntrinsics.cpp.in b/src/passes/WasmIntrinsics.cpp.in index c750c56dd..2eaaec439 100644 --- a/src/passes/WasmIntrinsics.cpp.in +++ b/src/passes/WasmIntrinsics.cpp.in @@ -1,7 +1,7 @@ #include "passes/intrinsics-module.h" -static const char theModule[@WASM_INTRINSICS_SIZE_2@] = { -@WASM_INTRINSICS_EMBED_2@ +static const char theModule[] = { +@WASM_INTRINSICS_EMBED@ }; namespace wasm { |