From 57fe147115ee718b4a019d17ecded5e3e5936ca0 Mon Sep 17 00:00:00 2001 From: Xu Zhen Date: Tue, 23 Jun 2020 12:23:41 +0800 Subject: [PATCH] Fixed CMake with MinGW 4.9 --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d426ffcf5..421e11377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,13 @@ else() # minimum required standard set(CMAKE_CXX_STANDARD 11) endif() +if ("${CMAKE_CXX17_STANDARD_COMPILE_OPTION}" STREQUAL "") + set(CMAKE_CXX_STANDARD 14) +endif() +if ("${CMAKE_CXX14_STANDARD_COMPILE_OPTION}" STREQUAL "") + set(CMAKE_CXX_STANDARD 11) +endif() + # Avoid using experimental c++1y (c++1z) standard even if the compiler announces cxx14 (cxx17) # in CMAKE_CXX_KNOWN_FEATURES and CMAKE_CXX_COMPILE_FEATURES # It is the case of clang 3.9, 4.0 (announces c++1z) and gcc 4.8 (announces c++1y)