From 39645dbda08a339d9d4efc907dd7efc06711e0c1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 3 Aug 2018 13:03:05 -0300 Subject: [PATCH] Use CMAKE_CXX_STANDARD to use C++11 flags --- CMakeLists.txt | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e3edb4a7..a0119c7fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,14 +3,10 @@ # # Parts of this file come from the Allegro 4.4 CMakeLists.txt -# CMake setup -if(WIN32) - # We need 3.4 to use manifests in the source files list for the main - # application target. - cmake_minimum_required(VERSION 3.4) -else() - cmake_minimum_required(VERSION 2.8) -endif() +cmake_minimum_required(VERSION 3.4) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED On) if(COMMAND cmake_policy) # CMP0003: Libraries linked via full path no longer produce linker search paths. @@ -189,17 +185,6 @@ else() add_definitions(-DNDEBUG) 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) set(CURL_STATICLIB ON BOOL) endif()