From a919e6aa6852e7dd3d58c7456fff4f7c8f3583ae Mon Sep 17 00:00:00 2001 From: Harrm Date: Sat, 9 Dec 2023 20:39:03 +0300 Subject: [PATCH 1/3] Make WasmEdge a static dependency --- cmake/Hunter/config.cmake | 7 +++++-- cmake/dependencies.cmake | 5 ++++- core/runtime/wasm_edge/CMakeLists.txt | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake index a36c285bd0..f0282620a1 100644 --- a/cmake/Hunter/config.cmake +++ b/cmake/Hunter/config.cmake @@ -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 () diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 35562c5079..2159183417 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -79,7 +79,10 @@ 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) endif () hunter_add_package(zstd) diff --git a/core/runtime/wasm_edge/CMakeLists.txt b/core/runtime/wasm_edge/CMakeLists.txt index 38bf8423c5..b321ca5ca2 100644 --- a/core/runtime/wasm_edge/CMakeLists.txt +++ b/core/runtime/wasm_edge/CMakeLists.txt @@ -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") From 343ce00c1d7297a3fad29cfb1d14b42aecf3a08e Mon Sep 17 00:00:00 2001 From: Harrm Date: Mon, 11 Dec 2023 11:35:28 +0300 Subject: [PATCH 2/3] Add MacOS dependency --- cmake/dependencies.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake index 2159183417..2d1dde2a72 100644 --- a/cmake/dependencies.cmake +++ b/cmake/dependencies.cmake @@ -83,6 +83,9 @@ if ("${WASM_COMPILER}" STREQUAL "WasmEdge") 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) From c58b9c68a94ce2aa4ee11521f8596e555d16c768 Mon Sep 17 00:00:00 2001 From: Harrm Date: Mon, 11 Dec 2023 11:45:34 +0300 Subject: [PATCH 3/3] Add ncurses to init.sh --- scripts/init.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/init.sh b/scripts/init.sh index 78a34c5492..3fa83eafb3 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -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"