Commit 3314aa43 by Matt Clarkson

Allow the user to set the C++ standard to use

This is useful to test the library at different standard levels. Currently doesn't search for C++14 in 'auto' mode. Can enable in the future
parent 8b501603
...@@ -18,18 +18,16 @@ message("-- Version: ${VERSION}") ...@@ -18,18 +18,16 @@ message("-- Version: ${VERSION}")
set(GENERIC_LIB_VERSION ${VERSION}) set(GENERIC_LIB_VERSION ${VERSION})
string(SUBSTRING ${VERSION} 0 1 GENERIC_LIB_SOVERSION) string(SUBSTRING ${VERSION} 0 1 GENERIC_LIB_SOVERSION)
# Try and enable C++11. Don't use C++14 because it doesn't work in some # Import our CMake modules
# configurations.
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
include(AddCXXCompilerFlag) include(AddCXXCompilerFlag)
include(CXXFeatureCheck) include(CXXFeatureCheck)
check_cxx_compiler_flag(-std=c++11 HAVE_FLAG_CXX_11) # Try and enable C++11. Don't use C++14 because it doesn't work in some
check_cxx_compiler_flag(-std=c++0x HAVE_FLAG_CXX_0X) # configurations.
if (HAVE_FLAG_CXX_11) add_cxx_compiler_flag(-std=c++11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") if (NOT HAVE_CXX_FLAG_STD_CXX11)
elseif (HAVE_FLAG_CXX_0X) add_cxx_compiler_flag(-std=c++0x)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif() endif()
# Turn compiler warnings up to 11 # Turn compiler warnings up to 11
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment