build: Improve setting of C++ standard
Instead of manually testing for compiler flags we now rely on CMake to
set the correct C++ standard, which should be more robust across
different compilers.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18a87b4..170df93 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,12 +60,9 @@
#
# We require c++14 support
#
-CHECK_CXX_COMPILER_FLAG("-std=c++14" CXX_COMPILER_SUPPORTS_CXX14_FLAG)
-if(CXX_COMPILER_SUPPORTS_CXX14_FLAG)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
-else()
- message(FATAL_ERROR "Could not determine C++14 support for compiler ${CMAKE_CXX_COMPILER}. C++14 support is required.")
-endif()
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF) #No compiler specific extensions
#
# Warning flags