Open
Description
Timeline: Summer 2025
People on MacOS often get compiler errors since CMake defaults to clang++
instead of g++
, and clang doesn't support all of the features we use.
We should throw an error if the compiler is not GNU g++.
I got this snippet from reddit, haven't tested
if ((NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND
(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
message( FATAL_ERROR "Unsupported compiler! (Only GCC and Clang are supported.)" )
endif()
https://www.reddit.com/r/cpp_questions/comments/nmr95e/cmake_require_either_gcc_or_clang/
https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
Of course we need to modify it to only accept GNU.
This should go in the cli
and linux
mcal CMakeLists since it is a platform-dependent fix