From 12a6027b40ee0fa9e744d1d25333a2650fd9aed7 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 5 Aug 2016 08:22:45 -0700 Subject: [PATCH] Don't use -std compiler flag if CMAKE_CXX_STANDARD is specified (#366) --- support/cmake/cxx11.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support/cmake/cxx11.cmake b/support/cmake/cxx11.cmake index 31ea1063..02795a93 100644 --- a/support/cmake/cxx11.cmake +++ b/support/cmake/cxx11.cmake @@ -37,6 +37,11 @@ if (FMT_USE_CPP11) endif () endif () +if (CMAKE_CXX_STANDARD) + # Don't use -std compiler flag if CMAKE_CXX_STANDARD is specified. + set(CPP11_FLAG ) +endif () + set(CMAKE_REQUIRED_FLAGS ${CPP11_FLAG}) # Check if variadic templates are working and not affected by GCC bug 39653: