From 7abc82fd926321fa50115f2b0854d7d1d0be21b6 Mon Sep 17 00:00:00 2001 From: Jesse Rosenstock Date: Tue, 5 Jun 2018 17:42:23 -0400 Subject: [PATCH] Set CMAKE_CXX_STANDARD. Instead of setting the -std=c++11 compiler flag directly. Closes #35. --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cfccf03..2023b754 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.1) project(s2-geometry) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) include(CMakeDependentOption) @@ -56,12 +56,17 @@ if (APPLE) set(CMAKE_MACOSX_RPATH TRUE) endif() +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +# No compiler-specific extensions, i.e. -std=c++11, not -std=gnu++11. +set(CMAKE_CXX_EXTENSIONS OFF) + # Avoid megabytes of warnings like: # util/math/vector.h:178:16: warning: optimization attribute on # ‘double sqrt(double)’ follows definition but the attribute doesn’t # match [-Wattributes] add_definitions(-Wno-attributes) -add_definitions(-Wno-deprecated-declarations -std=c++11) +add_definitions(-Wno-deprecated-declarations) # If OpenSSL is installed in a non-standard location, configure with # something like: