Skip to content

Commit

Permalink
Merge pull request #2098 from ERGO-Code/cmake-cxx11
Browse files Browse the repository at this point in the history
Explicitly set c++11 in CMake
  • Loading branch information
galabovaa authored Jan 2, 2025
2 parents f7e3f15 + ca1b739 commit fc0d251
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ if (BUILD_CXX)
option(STDCALL "Build highs with the __stdcall convention" OFF)
endif()

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
endif()

# Basic type
include(CMakePushCheckState)
cmake_push_check_state(RESET)
Expand Down

0 comments on commit fc0d251

Please sign in to comment.