Update: Using C++26 with contracts enabled
This commit is contained in:
@@ -1,3 +1,22 @@
|
||||
# Use GCC 16 for C++26 contracts support on macOS (Homebrew).
|
||||
set(CMAKE_C_COMPILER "/opt/homebrew/bin/gcc-16" CACHE FILEPATH "C compiler")
|
||||
set(CMAKE_CXX_COMPILER "/opt/homebrew/bin/g++-16" CACHE FILEPATH "C++ compiler")
|
||||
# GCC 16 toolchain for C++26 and contracts.
|
||||
find_program(
|
||||
COURSE_GCC16_C
|
||||
NAMES gcc-16
|
||||
HINTS /opt/homebrew/bin /usr/local/bin /opt/local/bin
|
||||
)
|
||||
find_program(
|
||||
COURSE_GCC16_CXX
|
||||
NAMES g++-16
|
||||
HINTS /opt/homebrew/bin /usr/local/bin /opt/local/bin
|
||||
)
|
||||
|
||||
if(NOT COURSE_GCC16_CXX)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"g++-16 not found. Install GCC 16, e.g. 'brew install gcc@16', "
|
||||
"then ensure g++-16 is on your PATH."
|
||||
)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_COMPILER "${COURSE_GCC16_C}" CACHE FILEPATH "C compiler" FORCE)
|
||||
set(CMAKE_CXX_COMPILER "${COURSE_GCC16_CXX}" CACHE FILEPATH "C++ compiler" FORCE)
|
||||
|
||||
Reference in New Issue
Block a user