From e17b7431416a61d936918066f828802482bd3f17 Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 11 May 2015 19:37:40 -0700 Subject: [PATCH] Workaround a MinGW bug --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db478f73..f0c50bf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,12 @@ if (HAVE_STD_CPP11_FLAG) check_cxx_source_compiles(" #include int main() {}" FMT_CPP11_CMATH) - if (FMT_CPP11_CMATH) + # Check if including works with -std=c++11. + # It may not in MinGW due to bug http://sourceforge.net/p/mingw/bugs/2024/. + check_cxx_source_compiles(" + #include + int main() {}" FMT_CPP11_IO_H) + if (FMT_CPP11_CMATH AND FMT_CPP11_IO_H) set(CPP11_FLAG -std=c++11) endif () set(CMAKE_REQUIRED_FLAGS )