Skip to content

Commit 4ebd1bb

Browse files
authored
wasi-nn: apply the shared library hack to darwin as well (#4374)
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 b3ce192 commit 4ebd1bb

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)