Use CMAKE_CXX_STANDARD to use C++11 flags

This commit is contained in:
David Capello 2018-08-03 13:03:05 -03:00
parent 74742141de
commit 39645dbda0

View File

@ -3,14 +3,10 @@
# #
# Parts of this file come from the Allegro 4.4 CMakeLists.txt # Parts of this file come from the Allegro 4.4 CMakeLists.txt
# CMake setup cmake_minimum_required(VERSION 3.4)
if(WIN32)
# We need 3.4 to use manifests in the source files list for the main set(CMAKE_CXX_STANDARD 11)
# application target. set(CMAKE_CXX_STANDARD_REQUIRED On)
cmake_minimum_required(VERSION 3.4)
else()
cmake_minimum_required(VERSION 2.8)
endif()
if(COMMAND cmake_policy) if(COMMAND cmake_policy)
# CMP0003: Libraries linked via full path no longer produce linker search paths. # CMP0003: Libraries linked via full path no longer produce linker search paths.
@ -189,17 +185,6 @@ else()
add_definitions(-DNDEBUG) add_definitions(-DNDEBUG)
endif() endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
elseif(UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
if(NOT USE_SHARED_CURL) if(NOT USE_SHARED_CURL)
set(CURL_STATICLIB ON BOOL) set(CURL_STATICLIB ON BOOL)
endif() endif()