Skip to content

Commit b51d97f

Browse files
authored
[CI] Fix framework unittests exit with code 0xc000007b on windows inference (#75631)
1 parent 410bf33 commit b51d97f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

test/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,15 @@ set_pir_tests_properties()
320320
add_subdirectory(deprecated)
321321
add_subdirectory(flex_checkpoint)
322322
add_subdirectory(compat)
323+
324+
if(WIN32 AND WITH_ONNXRUNTIME)
325+
add_custom_command(
326+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp/onnxruntime.dll
327+
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ONNXRUNTIME_SHARED_LIB}"
328+
"${CMAKE_CURRENT_BINARY_DIR}/cpp/onnxruntime.dll"
329+
DEPENDS onnxruntime
330+
COMMENT "Copying onnxruntime.dll to build/test/cpp")
331+
332+
add_custom_target(copy_onnxruntime ALL
333+
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/cpp/onnxruntime.dll)
334+
endif()

test/cpp/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,3 @@ add_subdirectory(compat)
1616
if(WITH_CINN)
1717
add_subdirectory(cinn)
1818
endif()
19-
20-
if(WIN32 AND WITH_ONNXRUNTIME)
21-
add_custom_command(
22-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime.dll
23-
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${ONNXRUNTIME_SHARED_LIB}"
24-
"${CMAKE_CURRENT_BINARY_DIR}/onnxruntime.dll"
25-
DEPENDS onnxruntime
26-
COMMENT "Copying onnxruntime.dll to build/test/cpp")
27-
28-
add_custom_target(copy_onnxruntime ALL
29-
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime.dll)
30-
endif()

0 commit comments

Comments
 (0)