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

This commit is contained in:
Alex Reinking 2020-01-31 02:16:25 -08:00 committed by GitHub
parent 5ac80de037
commit e5ea03ce07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,7 @@ foreach(p
CMP0056 # export EXE_LINKER_FLAGS to try_run
CMP0057 # Support no if() IN_LIST operator
CMP0063 # Honor visibility properties for all targets
CMP0077 # Allow option() overrides in importing projects
)
if(POLICY ${p})
cmake_policy(SET ${p} NEW)

View File

@ -148,7 +148,8 @@ if (BENCHMARK_HAS_CXX03_FLAG)
compile_benchmark_test(cxx03_test)
set_target_properties(cxx03_test
PROPERTIES
COMPILE_FLAGS "-std=c++03")
CXX_STANDARD 98
CXX_STANDARD_REQUIRED YES)
# libstdc++ provides different definitions within <map> between dialects. When
# 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