diff options
author | Brad King <brad.king@kitware.com> | 2015-06-29 13:22:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-29 13:25:57 (GMT) |
commit | 96c18defee8748369597de557fe0d221c3d2f16c (patch) | |
tree | 73326a82df1c831ac5329c7a049a854591269f63 /CMakeLists.txt | |
parent | adcf6a0b51032e4486e1ba0bac3f646166b09653 (diff) | |
download | CastXML-96c18defee8748369597de557fe0d221c3d2f16c.zip CastXML-96c18defee8748369597de557fe0d221c3d2f16c.tar.gz CastXML-96c18defee8748369597de557fe0d221c3d2f16c.tar.bz2 |
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 7 insertions, 1 deletions
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) |