Unverified Commit e5ea03ce by Alex Reinking Committed by GitHub

Fix cxx03 standard selection, option override in CMake 3.13+. Fixes #933 (#934)

parent 5ac80de0
...@@ -6,6 +6,7 @@ foreach(p ...@@ -6,6 +6,7 @@ foreach(p
CMP0056 # export EXE_LINKER_FLAGS to try_run CMP0056 # export EXE_LINKER_FLAGS to try_run
CMP0057 # Support no if() IN_LIST operator CMP0057 # Support no if() IN_LIST operator
CMP0063 # Honor visibility properties for all targets CMP0063 # Honor visibility properties for all targets
CMP0077 # Allow option() overrides in importing projects
) )
if(POLICY ${p}) if(POLICY ${p})
cmake_policy(SET ${p} NEW) cmake_policy(SET ${p} NEW)
......
...@@ -148,7 +148,8 @@ if (BENCHMARK_HAS_CXX03_FLAG) ...@@ -148,7 +148,8 @@ if (BENCHMARK_HAS_CXX03_FLAG)
compile_benchmark_test(cxx03_test) compile_benchmark_test(cxx03_test)
set_target_properties(cxx03_test set_target_properties(cxx03_test
PROPERTIES PROPERTIES
COMPILE_FLAGS "-std=c++03") CXX_STANDARD 98
CXX_STANDARD_REQUIRED YES)
# libstdc++ provides different definitions within <map> between dialects. When # libstdc++ provides different definitions within <map> between dialects. When
# LTO is enabled and -Werror is specified GCC diagnoses this ODR violation # LTO is enabled and -Werror is specified GCC diagnoses this ODR violation
# causing the test to fail to compile. To prevent this we explicitly disable # causing the test to fail to compile. To prevent this we explicitly disable
......
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