Skip to content

Commit

Permalink
Set CMAKE_CXX_STANDARD to 17 when building dependencies (if no standa…
Browse files Browse the repository at this point in the history
…rd has been set already)
  • Loading branch information
DavidAce committed Jun 1, 2021
1 parent de3eb16 commit 81f2044
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/BuildDependency.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ function(build_dependency dep_name install_dir extra_flags)
set(ENV{FC} ${CMAKE_Fortran_COMPILER})
endif()

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(NOT CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
endif()
if(NOT CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS FALSE)
endif()

execute_process( COMMAND ${CMAKE_COMMAND} -E remove ${build_dir}/CMakeCache.txt)
execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${build_dir})
execute_process(
Expand Down

0 comments on commit 81f2044

Please sign in to comment.