File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -60,17 +60,27 @@ endif()
6060
6161# Google C++ tests
6262if (BUILD_CPP_TEST)
63- find_package (GTest 1.11 .0 )
63+ find_package (GTest 1.14 .0 )
6464 if (NOT GTest_FOUND)
6565 message (STATUS "Did not find Google Test in the system root. Fetching Google Test now..." )
6666 FetchContent_Declare (
6767 googletest
68- GIT_REPOSITORY https://github.com/google/googletest.git
69- GIT_TAG release-1.11.0
68+ URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz
7069 )
70+ set (gtest_force_shared_crt ${DMLC_FORCE_SHARED_CRT} CACHE BOOL "" FORCE )
7171 FetchContent_MakeAvailable (googletest)
72+
7273 add_library (GTest::gtest ALIAS gtest )
7374 add_library (GTest::gmock ALIAS gmock )
75+ target_compile_definitions (gtest PRIVATE ${ENABLE_GNU_EXTENSION_FLAGS} )
76+ target_compile_definitions (gmock PRIVATE ${ENABLE_GNU_EXTENSION_FLAGS} )
77+ foreach (target gtest gmock)
78+ target_compile_features (${target} PUBLIC cxx_std_14 )
79+ if (MSVC )
80+ set_target_properties (${target} PROPERTIES
81+ MSVC_RUNTIME_LIBRARY "${Treelite_USE_DYNAMIC_MSVC_RUNTIME} " )
82+ endif ()
83+ endforeach ()
7484 if (IS_DIRECTORY "${googletest_SOURCE_DIR} " )
7585 # Do not install gtest
7686 set_property (DIRECTORY ${googletest_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL YES )
You can’t perform that action at this time.
0 commit comments