summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-06-29 13:22:58 (GMT)
committerBrad King <brad.king@kitware.com>2015-06-29 13:25:57 (GMT)
commit96c18defee8748369597de557fe0d221c3d2f16c (patch)
tree73326a82df1c831ac5329c7a049a854591269f63 /CMakeLists.txt
parentadcf6a0b51032e4486e1ba0bac3f646166b09653 (diff)
downloadCastXML-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.txt8
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)