Skip to content

Commit

Permalink
Allow using C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn authored Jan 22, 2024
1 parent 74ecd5b commit 6ca74ac
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@ if (CMAKE_CUDA_COMPILER)
set (CUDA_FOUND TRUE)
endif()

set(CMAKE_CXX_STANDARD 20)
# add_compile_definitions(USE_CXX17=1)

if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9)
message(FATAL_ERROR "GCC version must be greater than or equal to 9")
endif()

if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9)
add_compile_definitions(USE_CXX17=1)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 20)
endif()

set(GENERATORS_ROOT ${PROJECT_SOURCE_DIR}/src)
set(MODELS_ROOT ${PROJECT_SOURCE_DIR}/src/models)
Expand Down

0 comments on commit 6ca74ac

Please sign in to comment.