Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make WasmEdge a static dependency #1896

Merged
merged 5 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ if ("${WASM_COMPILER}" STREQUAL "WasmEdge")

hunter_config(
WasmEdge
URL https://github.com/harrm/WasmEdge/archive/8a52b27e2592fc9934b6132e80f69ae6d6925997.zip
SHA1 fbdd08bd648faffa7d140387eb98b437d0f6d5ea
URL https://github.com/harrm/WasmEdge/archive/883347307736bb09c56e7a9a48b874a7380d20a7.zip
SHA1 22b1740fb9e8d94d329fb7f42d1615c4f16b3297
CMAKE_ARGS
WASMEDGE_BUILD_STATIC_LIB=ON
WASMEDGE_BUILD_SHARED_LIB=OFF
KEEP_PACKAGE_SOURCES
)
endif ()
Expand Down
8 changes: 7 additions & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ endif ()

if ("${WASM_COMPILER}" STREQUAL "WasmEdge")
hunter_add_package(WasmEdge)
find_library(WASM_EDGE_LIBRARY NAMES wasmedge REQUIRED PATHS "${WASMEDGE_ROOT}")
find_library(WASM_EDGE_LIBRARY NAMES libwasmedge.a REQUIRED PATHS "${WASMEDGE_ROOT}")
add_library(WasmEdge::WasmEdge STATIC IMPORTED)
set_property(TARGET WasmEdge::WasmEdge PROPERTY IMPORTED_LOCATION "${WASM_EDGE_LIBRARY}")
target_link_libraries(WasmEdge::WasmEdge INTERFACE curses)
if (APPLE)
target_link_libraries(WasmEdge::WasmEdge INTERFACE xar)
endif()
endif ()

hunter_add_package(zstd)
Expand Down
2 changes: 1 addition & 1 deletion core/runtime/wasm_edge/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

add_library(runtime_wasm_edge module_factory_impl.cpp memory_impl.cpp)
target_link_libraries(runtime_wasm_edge "${WASM_EDGE_LIBRARY}" memory_allocator)
target_link_libraries(runtime_wasm_edge WasmEdge::WasmEdge memory_allocator)
target_include_directories(runtime_wasm_edge PRIVATE "${WASMEDGE_ROOT}/include")
4 changes: 3 additions & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ cd $parent_dir
set -a; source $current_dir/.env; set +a #include .env vars

apt update
apt install --no-install-recommends -y build-essential git gcc ca-certificates python-is-python3 python3-pip python3-venv curl libgmp-dev
apt install --no-install-recommends -y \
build-essential git gcc ca-certificates python-is-python3 python3-pip \
python3-venv curl libgmp-dev libncurses6

python3 -m venv "$parent_dir/venv"

Expand Down