From 5fac8189653bb1a2bd4e93c62d09595dd35ac5c7 Mon Sep 17 00:00:00 2001 From: Gleb Belov Date: Fri, 23 Feb 2024 15:33:01 +1100 Subject: [PATCH] C++17 --- CMakeLists.txt | 6 +++--- nl-writer2/CMakeLists.txt | 2 +- solvers/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97aa13bb2..e61256f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,8 @@ include(init) project(MP) -# Set the c++11 flag without GNU extensions. -set(CMAKE_CXX_STANDARD 11) +# Set the c++17 flag without GNU extensions. +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -258,7 +258,7 @@ function (add_mp_library name) PUBLIC ${add_mp_library_COMPILE_DEFINITIONS}) target_include_directories(${name} PUBLIC ${add_mp_library_INCLUDE_DIRECTORIES}) - set_property(TARGET ${name} PROPERTY CXX_STANDARD 11) + set_property(TARGET ${name} PROPERTY CXX_STANDARD 17) if (add_mp_library_DEPENDS) add_dependencies(${name} ${add_mp_library_DEPENDS}) endif () diff --git a/nl-writer2/CMakeLists.txt b/nl-writer2/CMakeLists.txt index cc7e84659..b9132960a 100644 --- a/nl-writer2/CMakeLists.txt +++ b/nl-writer2/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10) project(NLWriter2) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED True) diff --git a/solvers/CMakeLists.txt b/solvers/CMakeLists.txt index 9d98f29ab..59f135c42 100644 --- a/solvers/CMakeLists.txt +++ b/solvers/CMakeLists.txt @@ -147,7 +147,7 @@ function(add_ampl_solver name) if(add_ampl_solver_VERSION) target_compile_definitions(${static_lib} PUBLIC DRIVER_DATE=${add_ampl_solver_VERSION}) endif() - set_property(TARGET ${static_lib} PROPERTY CXX_STANDARD 11) + set_property(TARGET ${static_lib} PROPERTY CXX_STANDARD 17) if (use_dll_runtime) target_link_libraries(${static_lib} PUBLIC mp-dynrt) else () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 760e36f42..4f9f85771 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -54,7 +54,7 @@ function(add_mp_test name) cmake_parse_arguments(add_mp_test "" "" LIBS ${ARGN}) add_executable(${name} ${add_mp_test_UNPARSED_ARGUMENTS}) set_target_properties(${name} PROPERTIES OUTPUT_NAME ${name}) - set_property(TARGET ${name} PROPERTY CXX_STANDARD 11) + set_property(TARGET ${name} PROPERTY CXX_STANDARD 17) if (MINGW) set_target_properties(${name} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++")