diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index e1954418263..05cc642417a 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -620,8 +620,12 @@ endif() # ---------------------------------------------------------------------- # ExternalProject options -set(EP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}}") -set(EP_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}}") +set( + EP_CXX_FLAGS + "${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}}" + ) +set(EP_C_FLAGS + "${CMAKE_C_COMPILER_ARG1} ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}}") if(NOT MSVC_TOOLCHAIN) # Set -fPIC on all external projects diff --git a/r/R/arrow-package.R b/r/R/arrow-package.R index 7696c47d98b..2515e7ac920 100644 --- a/r/R/arrow-package.R +++ b/r/R/arrow-package.R @@ -117,11 +117,14 @@ arrow_info <- function() { if (out$libarrow) { pool <- default_memory_pool() runtimeinfo <- runtime_info() + compute_funcs <- list_compute_functions() out <- c(out, list( capabilities = c( dataset = arrow_with_dataset(), parquet = arrow_with_parquet(), s3 = arrow_with_s3(), + utf8proc = "utf8_upper" %in% compute_funcs, + re2 = "replace_substring_regex" %in% compute_funcs, vapply(tolower(names(CompressionType)[-1]), codec_is_available, logical(1)) ), memory_pool = list( diff --git a/r/tests/testthat/helper-skip.R b/r/tests/testthat/helper-skip.R index 2c885cafd97..6fb97da000d 100644 --- a/r/tests/testthat/helper-skip.R +++ b/r/tests/testthat/helper-skip.R @@ -15,25 +15,16 @@ # specific language governing permissions and limitations # under the License. +build_features <- c( + arrow_info()$capabilities, + # Special handling for "uncompressed", for tests that iterate over compressions + uncompressed = TRUE +) + skip_if_not_available <- function(feature) { - if (feature == "dataset") { - skip_if_not(arrow_with_dataset()) - } else if (feature == "parquet") { - skip_if_not(arrow_with_parquet()) - } else if (feature %in% c("string", "utf8proc")) { - skip_if_not( - "utf8_upper" %in% list_compute_functions(), - "Arrow C++ library not built with utf8proc dependency" - ) - } else if (feature %in% c("regex", "re2")) { - skip_if_not( - "replace_substring_regex" %in% list_compute_functions(), - "Arrow C++ library not built with re2 dependency" - ) - } else if (feature == "s3") { - skip_if_not(arrow_with_s3()) - } else if (!codec_is_available(feature)) { - skip(paste("Arrow C++ not built with support for", feature)) + yes <- feature %in% names(build_features) && build_features[feature] + if (!yes) { + skip(paste("Arrow C++ not built with", feature)) } }