Not sure why c++11 is not respected when compiling for mac

This commit is contained in:
def 2018-01-14 14:36:25 +01:00
parent 2af80de4ea
commit 7726540de1

View file

@ -56,7 +56,7 @@ if(NOT(CMAKE_BUILD_TYPE))
set(CMAKE_BUILD_TYPE Release)
endif()
if(CMAKE_VERSION VERSION_LESS 3.1)
if(CMAKE_VERSION VERSION_LESS 3.1 OR TARGET_OS STREQUAL "mac")
if(CMAKE_CXX_COMPILER_ID MATCHES Clang OR CMAKE_CXX_COMPILER_ID MATCHES GNU)
if(CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
@ -1457,8 +1457,9 @@ foreach(target ${TARGETS_LINK})
endforeach()
foreach(target ${TARGETS_OWN})
if(CMAKE_VERSION VERSION_GREATER 3.1 OR CMAKE_VERSION VERSION_EQUAL 3.1)
if((CMAKE_VERSION VERSION_GREATER 3.1 OR CMAKE_VERSION VERSION_EQUAL 3.1) AND NOT TARGET_OS STREQUAL "mac")
set_property(TARGET ${target} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED ON)
endif()
if(MSVC)