Skip to content

Commit bd6aa35

Browse files
committed
apacheGH-45325: [C++] Improved error message when using clang++ without clang
1 parent 984519d commit bd6aa35

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cpp/cmake_modules/SetupCxxFlags.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ include(CheckCXXSourceCompiles)
2323

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

26+
set(UsingClang
27+
CMAKE_C_COMPILER_ID
28+
STREQUAL
29+
"AppleClang"
30+
OR
31+
CMAKE_C_COMPILER_ID
32+
STREQUAL
33+
"Clang")
34+
set(UsingClangPlusPlus
35+
CMAKE_CXX_COMPILER_ID
36+
STREQUAL
37+
"AppleClang"
38+
OR
39+
CMAKE_CXX_COMPILER_ID
40+
STREQUAL
41+
"Clang")
42+
43+
if(UsingClangPlusPlus and NOT UsingClang)
44+
error("When using clang++ you must also use clang")
45+
endif()
46+
2647
if(NOT DEFINED ARROW_CPU_FLAG)
2748
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
2849
set(ARROW_CPU_FLAG "emscripten")

0 commit comments

Comments
 (0)