فهرست منبع

bzip2: Add compilation flags to disable warnings in third-party code

Brad King 5 سال پیش
والد
کامیت
35acaa90c5
1فایلهای تغییر یافته به همراه9 افزوده شده و 0 حذف شده
  1. 9 0
      Utilities/cmbzip2/CMakeLists.txt

+ 9 - 0
Utilities/cmbzip2/CMakeLists.txt

@@ -1,4 +1,13 @@
 project(bzip2)
 project(bzip2)
+
+# Disable warnings to avoid changing 3rd party code.
+if(CMAKE_C_COMPILER_ID MATCHES
+    "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|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()
+
 add_definitions(-D_FILE_OFFSET_BITS=64)
 add_definitions(-D_FILE_OFFSET_BITS=64)
 add_library(cmbzip2
 add_library(cmbzip2
   blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c)
   blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c)