diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6a48a01a73..fdfd64cb83 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -167,7 +167,8 @@ file (STRINGS "${REPO_ROOT}/VERSION_NUMBER" ORT_VERSION) # under the MPL2 and possibly more permissive licenses (like BSD). add_definitions(-DEIGEN_MPL2_ONLY) if(MSVC) - add_definitions(-DEIGEN_HAS_CONSTEXPR -DEIGEN_HAS_VARIADIC_TEMPLATES -DEIGEN_HAS_CXX11_MATH -DEIGEN_HAS_CXX11_ATOMIC) + add_definitions(-DEIGEN_HAS_CONSTEXPR -DEIGEN_HAS_VARIADIC_TEMPLATES -DEIGEN_HAS_CXX11_MATH -DEIGEN_HAS_CXX11_ATOMIC + -DEIGEN_STRONG_INLINE=inline) endif() if(onnxruntime_CROSS_COMPILING) @@ -211,12 +212,6 @@ if (MSVC) set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link protobuf to static runtime libraries" FORCE) set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib for gtest" FORCE) endif() - #A compile option to improve code generation time, mostly for the code that heavily uses eigen. - check_cxx_compiler_flag(/d2ReducedOptimizeHugeFunctions HAS_D2ROHF) - if(HAS_D2ROHF) - SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /d2ReducedOptimizeHugeFunctions") - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /d2ReducedOptimizeHugeFunctions") - endif() #Always enable exception handling, even for Windows ARM string(APPEND CMAKE_CXX_FLAGS " /EHsc") string(APPEND CMAKE_C_FLAGS " /EHsc")