diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fe79b8d..dac8511e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -468,9 +468,29 @@ if (BUILD_TOOLS) ) # wasm2c + set(TEMPLATE_CMAKE ${WABT_SOURCE_DIR}/scripts/gen-wasm2c-templates.cmake) + + # wasm2c generated code templates + add_custom_command( + OUTPUT wasm2c_header_top.cc wasm2c_header_bottom.cc wasm2c_source_includes.cc wasm2c_source_declarations.cc + + COMMAND ${CMAKE_COMMAND} -D out="wasm2c_header_top.cc" -D in="${WABT_SOURCE_DIR}/src/template/wasm2c.top.h" -D symbol="s_header_top" -P ${TEMPLATE_CMAKE} + COMMAND ${CMAKE_COMMAND} -D out="wasm2c_header_bottom.cc" -D in="${WABT_SOURCE_DIR}/src/template/wasm2c.bottom.h" -D symbol="s_header_bottom" -P ${TEMPLATE_CMAKE} + COMMAND ${CMAKE_COMMAND} -D out="wasm2c_source_includes.cc" -D in="${WABT_SOURCE_DIR}/src/template/wasm2c.includes.c" -D symbol="s_source_includes" -P ${TEMPLATE_CMAKE} + COMMAND ${CMAKE_COMMAND} -D out="wasm2c_source_declarations.cc" -D in="${WABT_SOURCE_DIR}/src/template/wasm2c.declarations.c" -D symbol="s_source_declarations" -P ${TEMPLATE_CMAKE} + + DEPENDS ${WABT_SOURCE_DIR}/src/template/wasm2c.top.h + ${WABT_SOURCE_DIR}/src/template/wasm2c.bottom.h + ${WABT_SOURCE_DIR}/src/template/wasm2c.includes.c + ${WABT_SOURCE_DIR}/src/template/wasm2c.declarations.c + ) + + add_library(cwriter-template wasm2c_header_top.cc wasm2c_header_bottom.cc wasm2c_source_includes.cc wasm2c_source_declarations.cc) + wabt_executable( NAME wasm2c SOURCES src/tools/wasm2c.cc src/c-writer.cc + LIBS cwriter-template INSTALL ) |