diff --git a/CMakeLists.txt b/CMakeLists.txt index 60f7426a7f06..91a01442d6b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ option(ENABLE_HISTORY "Enable using GNU history for history in lua console" ON) if(NOT CMAKE_CROSSCOMPILING) try_run(IEEE754_TEST_RETURN_CODE IEEE754_TEST_COMPILED ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/compile_time_tests/ieee_754.cpp - OUTPUT_VARIABLE IEEE754_TEST_OUTPUT) + CMAKE_FLAGS "-DCXX_STANDARD=11" OUTPUT_VARIABLE IEEE754_TEST_OUTPUT) if(NOT IEEE754_TEST_RETURN_CODE EQUAL 0) message(${IEEE754_TEST_OUTPUT}) message(FATAL_ERROR "Your platform does not represent floating point numbers in the IEEE 754 format.") diff --git a/SConstruct b/SConstruct index e77c01b45cdf..b1ee757c54b1 100755 --- a/SConstruct +++ b/SConstruct @@ -319,6 +319,10 @@ if env["multilib_arch"]: # Some tests need to load parts of boost env.PrependENVPath('LD_LIBRARY_PATH', env["boostlibdir"]) +# Some tests require at least C++11 +env.AppendUnique(CCFLAGS = Split("-W -Wall"), CFLAGS = ["-std=c99"]) +env.AppendUnique(CXXFLAGS = "-std=c++" + env["cxx_std"]) + if env["prereqs"]: conf = env.Configure(**configure_args) @@ -463,10 +467,6 @@ for env in [test_env, client_env, env]: env.Append(CPPDEFINES = ["HAVE_CONFIG_H"]) if "gcc" in env["TOOLS"]: - env.AppendUnique(CCFLAGS = Split("-W -Wall"), CFLAGS = ["-std=c99"]) - - env.AppendUnique(CXXFLAGS = "-std=c++" + env["cxx_std"]) - if env['openmp']: env.AppendUnique(CXXFLAGS = ["-fopenmp"], LIBS = ["gomp"])