Skip to content

Commit fa6c3a3

Browse files
using the CMake config file
1 parent 38e9d2b commit fa6c3a3

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
# endif()
2323

2424
# First try to find ONNX Runtime using the CMake config file
25+
# FIXME: This is a temporary workaround for ONNX Runtime's broken CMake config on Linux.
26+
# See https://github.com/microsoft/onnxruntime/issues/25279
27+
# Once the upstream issue is fixed, this conditional can be safely removed.
28+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
29+
find_package(onnxruntime CONFIG QUIET)
30+
if(onnxruntime_FOUND)
31+
return()
32+
endif()
33+
endif()
2534

2635
# If not found via CMake config, try to find manually
2736
find_path(onnxruntime_INCLUDE_DIR

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ if(WAMR_BUILD_WASI_NN_ONNX EQUAL 1)
123123

124124
target_include_directories(
125125
wasi_nn_onnx
126-
PUBLIC
127-
${onnxruntime_INCLUDE_DIR}/onnx
128-
${onnxruntime_INCLUDE_DIR}
126+
PUBLIC ${INTERFACE_INCLUDE_DIRECTORIES}
129127
)
130128

131129
target_link_libraries(

0 commit comments

Comments
 (0)