Skip to content

Commit 61cb972

Browse files
authored
wasi-nn: fix shared library filenames for macOS (#4306)
tested with openvino
1 parent ae6e490 commit 61cb972

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

core/iwasm/libraries/wasi-nn/src/wasi_nn.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@
2121
#include "wasm_export.h"
2222

2323
#define HASHMAP_INITIAL_SIZE 20
24-
#define TFLITE_BACKEND_LIB "libwasi_nn_tflite.so"
25-
#define OPENVINO_BACKEND_LIB "libwasi_nn_openvino.so"
26-
#define LLAMACPP_BACKEND_LIB "libwasi_nn_llamacpp.so"
24+
#if defined(__APPLE__)
25+
#define LIB_EXTENTION ".dylib"
26+
#else
27+
#define LIB_EXTENTION ".so"
28+
#endif
29+
#define TFLITE_BACKEND_LIB "libwasi_nn_tflite" LIB_EXTENTION
30+
#define OPENVINO_BACKEND_LIB "libwasi_nn_openvino" LIB_EXTENTION
31+
#define LLAMACPP_BACKEND_LIB "libwasi_nn_llamacpp" LIB_EXTENTION
2732

2833
/* Global variables */
2934
struct backends_api_functions {

0 commit comments

Comments
 (0)