1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00
Files
CMake/Utilities/cmzstd/CMakeLists.txt
Brad King 80af3ddea7 zstd: Disable BMI2 instructions for build within CMake
Our nightly and release binaries build in an environment that does not
support these instructions.  Disable them everywhere for simplicity
because CMake's application of this library is not performance-critical.
2019-03-15 10:05:23 -04:00

48 lines
1.4 KiB
CMake

project(zstd C)
# 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()
include_directories(lib lib/common)
add_library(cmzstd STATIC
lib/common/entropy_common.c
lib/common/error_private.c
lib/common/fse_decompress.c
lib/common/pool.c
lib/common/threading.c
lib/common/xxhash.c
lib/common/zstd_common.c
lib/compress/fse_compress.c
lib/compress/hist.c
lib/compress/huf_compress.c
lib/compress/zstd_compress.c
lib/compress/zstd_double_fast.c
lib/compress/zstd_fast.c
lib/compress/zstd_lazy.c
lib/compress/zstd_ldm.c
lib/compress/zstdmt_compress.c
lib/compress/zstd_opt.c
lib/decompress/huf_decompress.c
lib/decompress/zstd_ddict.c
lib/decompress/zstd_decompress_block.c
lib/decompress/zstd_decompress.c
lib/deprecated/zbuff_common.c
lib/deprecated/zbuff_compress.c
lib/deprecated/zbuff_decompress.c
lib/dictBuilder/cover.c
lib/dictBuilder/divsufsort.c
lib/dictBuilder/fastcover.c
lib/dictBuilder/zdict.c
)
# BMI2 instructions are not supported in older environments.
set_property(TARGET cmzstd PROPERTY COMPILE_DEFINITIONS DYNAMIC_BMI2=0)
install(FILES LICENSE DESTINATION ${CMAKE_DOC_DIR}/cmzstd)