Skip to content

Commit

Permalink
ARROW-6925: [C++] Only add -stdlib flag on MacOS when using clang.
Browse files Browse the repository at this point in the history
Non-clang gcc doesn't accept the -stdlib flag, so on MacOS, check COMPILER_FAMILY before adding the flag.

Closes #5702 from jcnorris00/master and squashes the following commits:

bc380a7 <John Norris> Only add -stdlib flag on MacOS when using clang.

Authored-by: John Norris <[email protected]>
Signed-off-by: François Saint-Jacques <[email protected]>
  • Loading branch information
jcnorris00 authored and fsaintjacques committed Oct 21, 2019
1 parent 2771140 commit bbad94a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/cmake_modules/SetupCxxFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ if(ARROW_USE_SIMD)
add_definitions(-DARROW_USE_SIMD)
endif()

if(APPLE)
if(APPLE AND "${COMPILER_FAMILY}" STREQUAL "clang")
# Depending on the default OSX_DEPLOYMENT_TARGET (< 10.9), libstdc++ may be
# the default standard library which does not support C++11. libc++ is the
# default from 10.9 onward.
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ macro(build_benchmark)
set(GBENCHMARK_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} -std=c++11")
endif()

if(APPLE)
if(APPLE AND "${COMPILER_FAMILY}" STREQUAL "clang")
set(GBENCHMARK_CMAKE_CXX_FLAGS "${GBENCHMARK_CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()

Expand Down

0 comments on commit bbad94a

Please sign in to comment.