Skip to content

Commit 2d3e634

Browse files
committed
wasi-nn: apply the shared library hack to darwin as well
copied from the linux version. i'm a bit skeptical with this workaround though. it might be simpler to prohibit the use of wamr api in these shared libraries. after all, what these libraries do is nothing specific to wasm.
1 parent 2f0750a commit 2d3e634

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

product-mini/platforms/darwin/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
114114

115115
set (CMAKE_MACOSX_RPATH True)
116116

117+
# if enable wasi-nn, both wasi-nn-backends and iwasm
118+
# need to use same WAMR (dynamic) libraries
119+
if (WAMR_BUILD_WASI_NN EQUAL 1)
120+
set (BUILD_SHARED_LIBS ON)
121+
endif ()
122+
117123
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
118124

119125
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)

0 commit comments

Comments
 (0)