Skip to content

Commit

Permalink
Enabled C++ 20 if it is available.
Browse files Browse the repository at this point in the history
  • Loading branch information
KOLANICH committed Dec 25, 2019
1 parent 11fab0f commit ff433ab
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ else()
project(SQLiteCpp VERSION "2.4.0")
endif()

# non-mandatory, enables only if the compiler supports it
if(${CMAKE_VERSION} VERSION_GREATER "3.12")
set(CMAKE_CXX_STANDARD 20)
else()
if(${CMAKE_VERSION} VERSION_GREATER "3.8")
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 14)
endif()
endif()

message (STATUS "CMake version: ${CMAKE_VERSION}")

# Define useful variables to handle OS differences:
Expand Down

0 comments on commit ff433ab

Please sign in to comment.