Browse Source

libarchive: Suppress compiler warnings

We are not developing libarchive so we do not care about warnings.
Brad King 14 years ago
parent
commit
e1afd072bc

+ 8 - 0
Utilities/cmlibarchive/CMakeLists.txt

@@ -46,6 +46,14 @@ math(EXPR INTERFACE_VERSION  "11 + ${_minor}")
 # ?? Should there be more here ??
 SET(SOVERSION "${INTERFACE_VERSION}")
 
+# Disable warnings to avoid changing 3rd party code.
+IF("${CMAKE_C_COMPILER_ID}" MATCHES
+    "^(GNU|Clang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$")
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
+ELSEIF(BORLAND)
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
+ENDIF()
+
 # Enable CTest/CDash support
 include(CTest)
 

+ 2 - 1
Utilities/cmlibarchive/libarchive/archive_windows.h

@@ -73,7 +73,8 @@
 
 #if defined(_MSC_VER)
 /* TODO: Fix the code, don't suppress the warnings. */
-#pragma warning(disable:4244)   /* 'conversion' conversion from 'type1' to 'type2', possible loss of data */
+#pragma warning(push,1)
+#pragma warning(disable:4761)   /* integral size mismatch in argument; conversion supplied */
 #endif
 #if defined(__BORLANDC__)
 #pragma warn -8068	/* Constant out of range in comparison. */