Workaround a MinGW bug

This commit is contained in:
vitaut 2015-05-11 19:37:40 -07:00
parent c8688576f2
commit e17b743141

View File

@ -27,7 +27,12 @@ if (HAVE_STD_CPP11_FLAG)
check_cxx_source_compiles("
#include <cmath>
int main() {}" FMT_CPP11_CMATH)
if (FMT_CPP11_CMATH)
# Check if including <unistd.h> 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 <unistd.h>
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 )