summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-24 17:10:07 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-24 17:10:07 (GMT)
commit35acaa90c5ca7b868950301d7f601120e7018136 (patch)
treef01206141f2f59c3b1bbde00d9d81ca07d65fff8
parent3d47b0ae975668e6dbb8bf17319ca27c0b1af49d (diff)
downloadCMake-35acaa90c5ca7b868950301d7f601120e7018136.zip
CMake-35acaa90c5ca7b868950301d7f601120e7018136.tar.gz
CMake-35acaa90c5ca7b868950301d7f601120e7018136.tar.bz2
bzip2: Add compilation flags to disable warnings in third-party code
-rw-r--r--Utilities/cmbzip2/CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/Utilities/cmbzip2/CMakeLists.txt b/Utilities/cmbzip2/CMakeLists.txt
index 2aff69c..cb4a038 100644
--- a/Utilities/cmbzip2/CMakeLists.txt
+++ b/Utilities/cmbzip2/CMakeLists.txt
@@ -1,4 +1,13 @@
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_library(cmbzip2
blocksort.c huffman.c crctable.c randtable.c compress.c decompress.c bzlib.c)