Skip to content

Commit 0c164b6

Browse files
Manually set the imported target with name space
1 parent fa6c3a3 commit 0c164b6

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

core/iwasm/libraries/wasi-nn/cmake/Findonnxruntime.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ find_package_handle_standard_args(onnxruntime
7373
if(onnxruntime_FOUND)
7474
set(onnxruntime_LIBRARIES ${onnxruntime_LIBRARY})
7575
set(onnxruntime_INCLUDE_DIRS ${onnxruntime_INCLUDE_DIR})
76-
77-
if(NOT TARGET onnxruntime)
78-
add_library(onnxruntime UNKNOWN IMPORTED)
79-
set_target_properties(onnxruntime PROPERTIES
76+
77+
if(NOT TARGET onnxruntime::onnxruntime)
78+
add_library(onnxruntime::onnxruntime UNKNOWN IMPORTED)
79+
set_target_properties(onnxruntime::onnxruntime PROPERTIES
8080
IMPORTED_LOCATION "${onnxruntime_LIBRARY}"
8181
INTERFACE_INCLUDE_DIRECTORIES "${onnxruntime_INCLUDE_DIRS}"
8282
)

core/iwasm/libraries/wasi-nn/cmake/wasi_nn.cmake

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,11 @@ if(WAMR_BUILD_WASI_NN_ONNX EQUAL 1)
121121
${WASI_NN_ROOT}/src/wasi_nn_onnx.cpp
122122
)
123123

124-
target_include_directories(
125-
wasi_nn_onnx
126-
PUBLIC ${INTERFACE_INCLUDE_DIRECTORIES}
127-
)
128-
129124
target_link_libraries(
130125
wasi_nn_onnx
131126
PUBLIC
132127
vmlib
133-
onnxruntime
128+
onnxruntime::onnxruntime
134129
)
135130

136131
install(TARGETS wasi_nn_onnx DESTINATION lib)

0 commit comments

Comments
 (0)