diff --git a/support/cmake/cxx14.cmake b/support/cmake/cxx14.cmake index c86cf508..d725917a 100644 --- a/support/cmake/cxx14.cmake +++ b/support/cmake/cxx14.cmake @@ -40,6 +40,17 @@ if (FMT_USE_CPP14) check_cxx_compiler_flag(-std=c++1y HAVE_STD_CPP1Y_FLAG) if (HAVE_STD_CPP1Y_FLAG) set(CPP14_FLAG -std=c++1y) + else () + # Fallback on c++11 if c++14 is not available. + check_cxx_compiler_flag(-std=c++11 HAVE_STD_CPP11_FLAG) + if (HAVE_STD_CPP11_FLAG) + set(CPP14_FLAG -std=c++11) + else () + check_cxx_compiler_flag(-std=c++0x HAVE_STD_CPP11_FLAG) + if (HAVE_STD_CPP0X_FLAG) + set(CPP14_FLAG -std=c++0x) + endif () + endif () endif () endif () endif ()