From 96c18defee8748369597de557fe0d221c3d2f16c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 29 Jun 2015 09:22:58 -0400 Subject: Fix compilation with GNU tools on Windows With MinGW and Cygwin tools, LLVM upstream uses -std=gnu++11 instead of -std=c++11 because the latter lacks things like "strdup". Do the same. GitHub-Issue: 19 --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c695c9..ebb234f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,13 @@ if(NOT CastXML_INSTALL_MAN_DIR) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -std=c++11") + if(CYGWIN OR MINGW) + # Use GNU extensions on Windows as LLVM upstream does. + set(std_cxx11 "-std=gnu++11") + else() + set(std_cxx11 "-std=c++11") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti ${std_cxx11}") endif() set(KWSYS_NAMESPACE cxsys) -- cgit v0.12