diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 3cee60f3..3328fc06 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -327,7 +327,7 @@ if(Protobuf_FOUND OR Protobuf_FOUND) if(NOT Protobuf_USE_STATIC_LIBS) #Indeed here should be a warning, not a fatal error. ONNX Runtime itself can work in such a #setting but it may cause compatibility issue when ONNX Runtime is integrated with the other ONNX ecosystem softwares. - message(FATAL_ERROR "Please enable Protobuf_USE_STATIC_LIBS") + message(WARNING "Please enable Protobuf_USE_STATIC_LIBS") endif() else() set(PROTOBUF_LIB protobuf::libprotobuf-lite) @@ -395,7 +395,7 @@ get_filename_component(REPO_ROOT "${REPO_ROOT}" ABSOLUTE) set(ONNXRUNTIME_INCLUDE_DIR ${REPO_ROOT}/include/onnxruntime) -add_subdirectory(external/date EXCLUDE_FROM_ALL) +find_package(date REQUIRED) if(onnxruntime_PREFER_SYSTEM_LIB) find_package(re2) diff --git a/cmake/external/Findre2.cmake b/cmake/external/Findre2.cmake new file mode 100644 index 00000000..4c91696c --- /dev/null +++ b/cmake/external/Findre2.cmake @@ -0,0 +1,3 @@ +find_package(PkgConfig) +pkg_check_modules(re2 REQUIRED IMPORTED_TARGET GLOBAL re2) +add_library(re2::re2 ALIAS PkgConfig::re2) diff --git a/cmake/onnxruntime_common.cmake b/cmake/onnxruntime_common.cmake index d33e9e14..5770e818 100644 --- a/cmake/onnxruntime_common.cmake +++ b/cmake/onnxruntime_common.cmake @@ -86,7 +86,7 @@ if (onnxruntime_USE_MIMALLOC_STL_ALLOCATOR OR onnxruntime_USE_MIMALLOC_ARENA_ALL endif() endif() -onnxruntime_add_include_to_target(onnxruntime_common date_interface wil) +onnxruntime_add_include_to_target(onnxruntime_common date::date wil) target_include_directories(onnxruntime_common PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${ONNXRUNTIME_ROOT} ${eigen_INCLUDE_DIRS} # safeint is part of onnxruntime_common public interface, so we want to propagate its includes diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index d1bd347c..0c4b81e4 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -40,7 +40,7 @@ function(AddTest) else() target_link_libraries(${_UT_TARGET} PRIVATE ${_UT_LIBS} GTest::gtest GTest::gmock ${onnxruntime_EXTERNAL_LIBRARIES}) endif() - onnxruntime_add_include_to_target(${_UT_TARGET} date_interface) + onnxruntime_add_include_to_target(${_UT_TARGET} date::date) target_include_directories(${_UT_TARGET} PRIVATE ${TEST_INC_DIR}) if (onnxruntime_USE_CUDA) target_include_directories(${_UT_TARGET} PRIVATE ${CUDA_INCLUDE_DIRS} ${onnxruntime_CUDNN_HOME}/include) diff --git a/onnxruntime/core/session/inference_session_utils.h b/onnxruntime/core/session/inference_session_utils.h index 57159083..9fa7dce0 100644 --- a/onnxruntime/core/session/inference_session_utils.h +++ b/onnxruntime/core/session/inference_session_utils.h @@ -6,7 +6,7 @@ #pragma warning(push) #pragma warning(disable : 28020) #endif -#include "single_include/nlohmann/json.hpp" +#include #ifdef _WIN32 #pragma warning(pop) #endif