Skip to content

Commit dabf541

Browse files
authored
Merge branch 'main' into rename-build-testing-option
2 parents f8dbf0e + e7cd616 commit dabf541

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @y-scope/maintainers

CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
cmake_minimum_required(VERSION 3.22.1)
2+
23
project(YSTDLIB_CPP LANGUAGES CXX)
34

45
set(YSTDLIB_CPP_VERSION "0.0.1" CACHE STRING "Project version.")
56

7+
# Require compiler versions that support the C++20 features necessary for compiling ystdlib-cpp
8+
if("AppleClang" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
9+
set(YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION "16")
10+
elseif("Clang" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
11+
set(YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION "16")
12+
elseif("GNU" STREQUAL "${CMAKE_CXX_COMPILER_ID}")
13+
set(YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION "11")
14+
else()
15+
message(
16+
FATAL_ERROR
17+
"Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}. Please use AppleClang, Clang, or GNU."
18+
)
19+
endif()
20+
if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "${YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION}")
21+
message(
22+
FATAL_ERROR
23+
"${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION} is too low. Must be at \
24+
least ${YSTDLIB_CPP_CMAKE_CXX_COMPILER_MIN_VERSION}."
25+
)
26+
endif()
27+
628
# Enable exporting compile commands
729
set(CMAKE_EXPORT_COMPILE_COMMANDS
830
ON

0 commit comments

Comments
 (0)