diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 01e1ab147af..84d65f59178 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2861,10 +2861,19 @@ function(build_simdjson) target_compile_definitions(simdjson PUBLIC SIMDJSON_EXCEPTIONS=0) - # The macOS 11.3 SDK has incomplete C++20 concepts support, which prevents - # simdjson headers from compiling. Disable simdjson concepts for this SDK. - if(CMAKE_OSX_SYSROOT AND CMAKE_OSX_SYSROOT MATCHES "MacOSX11\\.3\\.sdk$") - message(STATUS "Disabling simdjson concepts for macOS SDK 11.3") + # macOS SDKs before 13.3 ship a libc++ without and with incomplete + # , but simdjson enables its C++20 concepts API from the compiler's + # __cpp_concepts alone, so its headers fail to compile against those SDKs + # (GH-55267). Disable simdjson concepts for them. Arrow doesn't use that part + # of the simdjson API. simdjson considers these SDKs unsupported and won't fix + # this upstream, see https://github.com/simdjson/simdjson/issues/2787. + # + # The SDK directory name may omit the minor version ("MacOSX11.sdk" on CRAN, + # "MacOSX11.3.sdk" in our as-cran CI job), so match both forms. This treats + # "MacOSX13.sdk" as too old, which is harmless. + if(CMAKE_OSX_SYSROOT AND CMAKE_OSX_SYSROOT MATCHES + "MacOSX(1[0-2](\\.[0-9]+)?|13(\\.[0-2])?)\\.sdk$") + message(STATUS "Disabling simdjson concepts for macOS SDK older than 13.3") target_compile_definitions(simdjson PUBLIC SIMDJSON_CONCEPT_DISABLED=1) endif()