Skip to content

Commit a2114b0

Browse files
committed
explicit c++11 in cmake
1 parent f7e3f15 commit a2114b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,15 @@ if (BUILD_CXX)
187187
option(STDCALL "Build highs with the __stdcall convention" OFF)
188188
endif()
189189

190+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
191+
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
192+
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
193+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
194+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
195+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
196+
endif()
197+
198+
190199
# Basic type
191200
include(CMakePushCheckState)
192201
cmake_push_check_state(RESET)

0 commit comments

Comments
 (0)