summaryrefslogtreecommitdiff
path: root/Utilities/cmbzip2/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmbzip2/CMakeLists.txt')
-rw-r--r--Utilities/cmbzip2/CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Utilities/cmbzip2/CMakeLists.txt b/Utilities/cmbzip2/CMakeLists.txt
new file mode 100644
index 0000000000..1d7b265d4c
--- /dev/null
+++ b/Utilities/cmbzip2/CMakeLists.txt
@@ -0,0 +1,21 @@
+project(bzip2)
+
+# Disable warnings to avoid changing 3rd party code.
+if(CMAKE_C_COMPILER_ID MATCHES
+ "^(GNU|LCC|Clang|AppleClang|IBMClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM|NVHPC)$")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
+elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall")
+endif()
+
+# Activate POSIX APIs.
+if(CMAKE_SYSTEM_NAME MATCHES "^(AIX|OS400)$")
+ add_definitions(-D_ALL_SOURCE)
+endif()
+if(NOT CMAKE_SYSTEM_NAME MATCHES "BSD|Darwin|Windows")
+ add_definitions(-D_XOPEN_SOURCE=600)
+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)