summaryrefslogtreecommitdiff
path: root/Utilities/cmexpat
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-05 15:15:02 -0400
committerBrad King <brad.king@kitware.com>2016-05-05 15:17:16 -0400
commit58216d16946b7a14570f1a1dd4d260ed146b3faa (patch)
treed79aaba059581b513316a2912a28e963b7e66be5 /Utilities/cmexpat
parentf177c8a0a7695bfee618e08357291d893b45613b (diff)
downloadcmake-58216d16946b7a14570f1a1dd4d260ed146b3faa.tar.gz
expat: Suppress compiler warnings
We are not developing expat so we do not care about warnings.
Diffstat (limited to 'Utilities/cmexpat')
-rw-r--r--Utilities/cmexpat/CMakeLists.txt8
-rw-r--r--Utilities/cmexpat/lib/winconfig.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/Utilities/cmexpat/CMakeLists.txt b/Utilities/cmexpat/CMakeLists.txt
index 3781821984..d294165477 100644
--- a/Utilities/cmexpat/CMakeLists.txt
+++ b/Utilities/cmexpat/CMakeLists.txt
@@ -1,3 +1,11 @@
+# Disable warnings to avoid changing 3rd party code.
+IF(CMAKE_C_COMPILER_ID MATCHES
+ "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
+ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
+ENDIF()
+
include(ConfigureChecks.cmake)
if(WIN32)
add_definitions(-DCOMPILING_FOR_WINDOWS)
diff --git a/Utilities/cmexpat/lib/winconfig.h b/Utilities/cmexpat/lib/winconfig.h
index 908d714808..d7dad38f7b 100644
--- a/Utilities/cmexpat/lib/winconfig.h
+++ b/Utilities/cmexpat/lib/winconfig.h
@@ -19,4 +19,9 @@
#include "expat_config.h"
+#if defined(_MSC_VER)
+# pragma warning(push,1)
+# pragma warning(disable:4311) /* pointer truncation */
+#endif
+
#endif /* ndef WINCONFIG_H */