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 )