diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake index e473bc9d41..a097a9dcba 100644 --- a/cmake/onnxruntime_common.cmake +++ b/cmake/onnxruntime_common.cmake @@ -27,6 +27,8 @@ if(WIN32) "${ONNXRUNTIME_ROOT}/core/platform/windows/logging/*.h" "${ONNXRUNTIME_ROOT}/core/platform/windows/logging/*.cc" ) + # wndows platform adapter code uses advapi32 + list(APPEND onnxruntime_EXTERNAL_LIBRARIES advapi32) else() list(APPEND onnxruntime_common_src_patterns "${ONNXRUNTIME_ROOT}/core/platform/posix/*.h" diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index f24daa2479..3e8f4d355f 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -599,7 +599,7 @@ endif() if (onnxruntime_BUILD_SHARED_LIB) set(onnxruntime_perf_test_libs onnxruntime_test_utils onnx_test_runner_common onnxruntime_common re2 - onnx_test_data_proto onnx_proto libprotobuf ${GETOPT_LIB_WIDE} onnxruntime + onnx_test_data_proto onnx_proto libprotobuf ${GETOPT_LIB_WIDE} onnxruntime ${onnxruntime_EXTERNAL_LIBRARIES} ${SYS_PATH_LIB} ${CMAKE_DL_LIBS}) if(onnxruntime_USE_NSYNC) list(APPEND onnxruntime_perf_test_libs nsync_cpp)