diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index c85964d47d9cc..cece13793e4bd 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -1325,6 +1325,7 @@ if(ARROW_USE_BOOST) if(TARGET Boost::process) # Boost >= 1.86 + target_compile_definitions(Boost::process INTERFACE "BOOST_PROCESS_HAVE_V1") target_compile_definitions(Boost::process INTERFACE "BOOST_PROCESS_HAVE_V2") else() # Boost < 1.86 diff --git a/cpp/src/arrow/testing/process.cc b/cpp/src/arrow/testing/process.cc index 0be1a800bd6cf..4e555c2b14b0e 100644 --- a/cpp/src/arrow/testing/process.cc +++ b/cpp/src/arrow/testing/process.cc @@ -32,9 +32,7 @@ // // [1] https://github.com/boostorg/process/issues/259 // [2] https://github.com/googleapis/storage-testbench/issues/669 -#ifdef _WIN32 -#define BOOST_PROCESS_FORCE_V1 -#else +#ifndef _WIN32 #define BOOST_PROCESS_USE_V2 #endif #endif @@ -63,7 +61,7 @@ #ifdef __MINGW32__ #define BOOST_USE_WINDOWS_H = 1 #endif -#ifdef BOOST_PROCESS_FORCE_V1 +#ifdef BOOST_PROCESS_HAVE_V1 #include #else #include @@ -85,7 +83,7 @@ namespace asio = BOOST_PROCESS_V2_ASIO_NAMESPACE; namespace process = BOOST_PROCESS_V2_NAMESPACE; namespace filesystem = process::filesystem; #else -#ifdef BOOST_PROCESS_FORCE_V1 +#ifdef BOOST_PROCESS_HAVE_V1 namespace process = boost::process::v1; namespace filesystem = boost::process::v1::filesystem; #else