Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8fb9116

Browse files
committed
Add check for minimal C++ compiler version
1 parent 6c62d35 commit 8fb9116

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎data/languages/cpp/CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ set(CMAKE_CXX_STANDARD 20)
44
set(CMAKE_CXX_STANDARD_REQUIRED True)
55
set(JSON_BuildTests OFF CACHE INTERNAL "")
66

7-
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
8-
# Add GCC-specific flags here.
9-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fconcepts")
10-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
11-
# Add Clang-specificflags here.
12-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
13-
# Add MSVC-specific flags here.
7+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
8+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
9+
message(FATAL_ERROR "GCC version must be at least 10!")
10+
endif()
11+
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
12+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
13+
message(FATAL_ERROR "Clang version must be at least 10!")
14+
endif()
15+
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
16+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.23)
17+
message(FATAL_ERROR "Visual Studio version must be at least 2019!")
18+
endif()
1419
endif()
1520

1621
project(solution

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /