Skip to content

Commit

Permalink
Use shared onnxruntime.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlizarraga committed Dec 18, 2023
1 parent 75affa7 commit dfa6b21
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1172,35 +1172,41 @@ endif()

if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
# Accuracy test runner
set(onnxruntime_acc_test_src_dir ${TEST_SRC_DIR}/acc_test)
set(onnxruntime_acc_test_src_patterns
"${onnxruntime_acc_test_src_dir}/*.cc"
"${onnxruntime_acc_test_src_dir}/*.h")
if (onnxruntime_BUILD_SHARED_LIB)
set(onnxruntime_acc_test_src_dir ${TEST_SRC_DIR}/acc_test)
set(onnxruntime_acc_test_src_patterns
"${onnxruntime_acc_test_src_dir}/*.cc"
"${onnxruntime_acc_test_src_dir}/*.h")

file(GLOB onnxruntime_acc_test_src CONFIGURE_DEPENDS
${onnxruntime_acc_test_src_patterns}
)
onnxruntime_add_executable(onnxruntime_acc_test ${onnxruntime_acc_test_src})
target_include_directories(onnxruntime_acc_test PRIVATE ${REPO_ROOT}/include/onnxruntime/core/session)
if (WIN32)
target_compile_options(onnxruntime_acc_test PRIVATE ${disabled_warnings})
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
set_target_properties(onnxruntime_acc_test PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
)
endif()
file(GLOB onnxruntime_acc_test_src CONFIGURE_DEPENDS
${onnxruntime_acc_test_src_patterns}
)
onnxruntime_add_executable(onnxruntime_acc_test ${onnxruntime_acc_test_src})
target_include_directories(onnxruntime_acc_test PRIVATE ${REPO_ROOT}/include/onnxruntime/core/session)
if (WIN32)
target_compile_options(onnxruntime_acc_test PRIVATE ${disabled_warnings})
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
set_target_properties(onnxruntime_acc_test PROPERTIES
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
)
endif()

if (onnxruntime_BUILD_SHARED_LIB)
set(onnxruntime_acc_test_libs onnxruntime)
target_link_libraries(onnxruntime_acc_test PRIVATE ${onnxruntime_acc_test_libs})
endif()
if(NOT WIN32)
list(APPEND onnxruntime_acc_test_libs ${CMAKE_DL_LIBS})
endif()
if (onnxruntime_LINK_LIBATOMIC)
list(APPEND onnxruntime_acc_test_libs atomic)
endif()
target_link_libraries(onnxruntime_acc_test PRIVATE ${onnxruntime_acc_test_libs} Threads::Threads)

set_target_properties(onnxruntime_acc_test PROPERTIES FOLDER "ONNXRuntimeTest")
set_target_properties(onnxruntime_acc_test PROPERTIES FOLDER "ONNXRuntimeTest")

if (onnxruntime_USE_TVM)
if (WIN32)
target_link_options(onnxruntime_acc_test PRIVATE "/STACK:4000000")
if (onnxruntime_USE_TVM)
if (WIN32)
target_link_options(onnxruntime_acc_test PRIVATE "/STACK:4000000")
endif()
endif()
endif()

Expand Down

0 comments on commit dfa6b21

Please sign in to comment.