Skip to content

Commit

Permalink
Update for latest wasm2c
Browse files Browse the repository at this point in the history
  • Loading branch information
shravanrn committed Jan 31, 2024
1 parent e944025 commit 295e242
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,16 @@ if(NOT wasiclang_POPULATED)
FetchContent_Populate(wasiclang)
endif()

FetchContent_Declare(
mod_wasm2c
GIT_REPOSITORY https://github.com/WebAssembly/wabt/
GIT_TAG main)
FetchContent_GetProperties(mod_wasm2c)
if(NOT mod_wasm2c_POPULATED)
FetchContent_Populate(mod_wasm2c)
endif()
# FetchContent_Declare(
# mod_wasm2c
# GIT_REPOSITORY https://github.com/WebAssembly/wabt/
# GIT_TAG main)
# FetchContent_GetProperties(mod_wasm2c)
# if(NOT mod_wasm2c_POPULATED)
# FetchContent_Populate(mod_wasm2c)
# endif()

# set (mod_wasm2c_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../wabt/")
set (mod_wasm2c_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../wabt/")

if(DEV)
if(MSVC)
Expand Down Expand Up @@ -213,8 +213,10 @@ if(DEV)
add_link_options(${RLBOX_SANITIZER_LINK_FLAGS})
endif()

set(WASM2C_RUNTIME_CODE ${WASM2C_RUNTIME_SOURCE_DIR}/wasm-rt-impl.c ${CMAKE_SOURCE_DIR}/src/wasm2c_rt_minwasi.c ${CMAKE_SOURCE_DIR}/src/wasm2c_rt_mem.c)
list(FILTER WASM2C_RUNTIME_CODE EXCLUDE REGEX "${WASM2C_RUNTIME_SOURCE_DIR}/examples/.*" )
set(WASM2C_RUNTIME_CODE ${WASM2C_RUNTIME_SOURCE_DIR}/wasm-rt-impl.c
${WASM2C_RUNTIME_SOURCE_DIR}/wasm-rt-mem-impl.c
${CMAKE_SOURCE_DIR}/src/wasm2c_rt_minwasi.c
${CMAKE_SOURCE_DIR}/src/wasm2c_rt_mem.c)

add_library(glue_lib STATIC ${GLUE_LIB_C} ${WASM2C_RUNTIME_CODE})
target_include_directories(glue_lib PRIVATE ${mod_wasm2c_SOURCE_DIR}/wasm2c
Expand Down

0 comments on commit 295e242

Please sign in to comment.