Skip to content

Commit

Permalink
apacheGH-45325: [C++] Improved error message when using clang++ witho…
Browse files Browse the repository at this point in the history
…ut clang
  • Loading branch information
WillAyd committed Jan 21, 2025
1 parent 984519d commit dd6538b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cpp/cmake_modules/SetupCxxFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ include(CheckCXXSourceCompiles)

message(STATUS "System processor: ${CMAKE_SYSTEM_PROCESSOR}")

if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(UsingClang TRUE)
else()
set(UsingClang FALSE)
endif()

# Check for Clang C++ compiler
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(UsingClangPlusPlus TRUE)
else()
set(UsingClangPlusPlus FALSE)
endif()

if(${UsingClangPlusPlus} AND NOT ${UsingClang})
message(FATAL_ERROR "When using clang++ you must also use clang")
endif()

if(NOT DEFINED ARROW_CPU_FLAG)
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(ARROW_CPU_FLAG "emscripten")
Expand Down

0 comments on commit dd6538b

Please sign in to comment.