assignUser commented on code in PR #45326:
URL: https://github.com/apache/arrow/pull/45326#discussion_r1924525997
##########
cpp/cmake_modules/SetupCxxFlags.cmake:
##########
@@ -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()
Review Comment:
Ah yeah that's nice:
```
CC=gcc CXX=clang++ cmake .
✔
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is Clang 18.1.3
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:6 (message):
Use same compiler for C and C++
```
##########
cpp/cmake_modules/SetupCxxFlags.cmake:
##########
@@ -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()
Review Comment:
Ah yeah that's nice:
```
CC=gcc CXX=clang++ cmake .
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is Clang 18.1.3
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:6 (message):
Use same compiler for C and C++
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]