mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Mac: don't use C++11 on older clang versions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
25501ebae7
commit
acb74f25f7
1 changed files with 17 additions and 13 deletions
|
@ -52,19 +52,23 @@ execute_process(
|
|||
|
||||
message(STATUS "Creating build files for Subsurface ${SSRF_VERSION_STRING}")
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
if (APPLE AND "${CMAKE_CXX_COMPILER_VERSION}" STRLESS "5.0")
|
||||
message(STATUS "Old compiler ${CMAKE_CXX_COMPILER_VERSION} doesn't support C++11")
|
||||
else()
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
# using Intel C++
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# pkgconfig for required libraries
|
||||
|
|
Loading…
Reference in a new issue