Skip to content

Commit 19c3260

Browse files
authored
GH-34861: [C++] Move GTest std version check into SYSTEM if branch (#34874)
### Rationale for this change Developers have reported that the current GTest std version check will break cpp microbenchmarks in BUNDLE mode. ### What changes are included in this PR? Move the check into SYSTEM if branch so that it gets triggered in a narrowed scope. ### Are these changes tested? Tested locally and will be covered by CI. ### Are there any user-facing changes? No * Closes: #34861 Authored-by: Haocheng Liu <lbtinglb@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 84ac7d5 commit 19c3260

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,15 +2229,15 @@ if(ARROW_TESTING)
22292229
1.10.0
22302230
USE_CONFIG
22312231
${GTEST_USE_CONFIG})
2232-
get_target_property(gtest_cxx_standard GTest::gtest INTERFACE_COMPILE_FEATURES)
22332232

2234-
if((${gtest_cxx_standard} STREQUAL "cxx_std_11") OR (${gtest_cxx_standard} STREQUAL
2235-
"cxx_std_14"))
2236-
message(FATAL_ERROR "System GTest is built with a C++ standard lower than 17. Use bundled GTest via passing in CMake flag
2233+
if(GTest_SOURCE STREQUAL "SYSTEM")
2234+
get_target_property(gtest_cxx_standard GTest::gtest INTERFACE_COMPILE_FEATURES)
2235+
if((${gtest_cxx_standard} STREQUAL "cxx_std_11") OR (${gtest_cxx_standard} STREQUAL
2236+
"cxx_std_14"))
2237+
message(FATAL_ERROR "System GTest is built with a C++ standard lower than 17. Use bundled GTest via passing in CMake flag
22372238
-DGTest_SOURCE=\"BUNDLED\"")
2238-
endif()
2239+
endif()
22392240

2240-
if(GTest_SOURCE STREQUAL "SYSTEM")
22412241
find_package(PkgConfig QUIET)
22422242
pkg_check_modules(gtest_PC
22432243
gtest

0 commit comments

Comments
 (0)