Skip to content

Commit

Permalink
Set CMAKE_CXX_STANDARD.
Browse files Browse the repository at this point in the history
Instead of setting the -std=c++11 compiler flag directly.

Closes #35.
  • Loading branch information
jmr committed Jun 5, 2018
1 parent de322f7 commit 7abc82f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7abc82f

Please sign in to comment.