diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 4e37cebe108..0720f567a4e 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -322,6 +322,7 @@ if(ARROW_BUILD_BENCHMARKS OR ARROW_BUILD_INTEGRATION OR ARROW_FUZZING) set(ARROW_JSON ON) + set(ARROW_TESTING ON) endif() if(ARROW_CUDA diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake index 64ec7fa28bd..11bc88c31ce 100644 --- a/cpp/cmake_modules/DefineOptions.cmake +++ b/cpp/cmake_modules/DefineOptions.cmake @@ -256,6 +256,8 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") define_option(ARROW_TENSORFLOW "Build Arrow with TensorFlow support enabled" OFF) + define_option(ARROW_TESTING "Build the Arrow testing libraries" OFF) + #---------------------------------------------------------------------- set_option_category("Thirdparty toolchain") diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 151ae6f7b2c..ac86d8a27f1 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1647,10 +1647,7 @@ macro(build_gtest) add_dependencies(GTest::gmock googletest_ep) endmacro() -if(ARROW_BUILD_TESTS - OR ARROW_BUILD_BENCHMARKS - OR ARROW_BUILD_INTEGRATION - OR ARROW_FUZZING) +if(ARROW_TESTING) resolve_dependency(GTest) if(NOT GTEST_VENDORED) diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt index f3aae96a80d..5a33eae5f57 100644 --- a/cpp/src/arrow/CMakeLists.txt +++ b/cpp/src/arrow/CMakeLists.txt @@ -530,11 +530,7 @@ if(ARROW_BUILD_STATIC AND ARROW_BUNDLED_STATIC_LIBS) ${_OTHER_LIBS}) endif() -if(ARROW_BUILD_TESTS - OR ARROW_BUILD_BENCHMARKS - OR ARROW_BUILD_INTEGRATION - OR ARROW_FUZZING) - +if(ARROW_TESTING) # that depend on gtest add_arrow_lib(arrow_testing CMAKE_PACKAGE_NAME diff --git a/cpp/src/arrow/flight/CMakeLists.txt b/cpp/src/arrow/flight/CMakeLists.txt index ddf4983d7a9..03483f4e8c3 100644 --- a/cpp/src/arrow/flight/CMakeLists.txt +++ b/cpp/src/arrow/flight/CMakeLists.txt @@ -101,7 +101,7 @@ foreach(LIB_TARGET ${ARROW_FLIGHT_LIBRARIES}) endforeach() # Define arrow_flight_testing library -if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS OR ARROW_BUILD_INTEGRATION) +if(ARROW_TESTING) add_arrow_lib(arrow_flight_testing CMAKE_PACKAGE_NAME ArrowFlightTesting