blender/build_files/build_environment/cmake/zstd.cmake
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

36 lines
1.1 KiB
CMake

# SPDX-License-Identifier: GPL-2.0-or-later
set(ZSTD_EXTRA_ARGS
-DZSTD_BUILD_PROGRAMS=OFF
-DZSTD_BUILD_SHARED=OFF
-DZSTD_BUILD_STATIC=ON
-DZSTD_BUILD_TESTS=OFF
-DZSTD_LEGACY_SUPPORT=OFF
-DZSTD_LZ4_SUPPORT=OFF
-DZSTD_LZMA_SUPPORT=OFF
-DZSTD_MULTITHREAD_SUPPORT=ON
-DZSTD_PROGRAMS_LINK_SHARED=OFF
-DZSTD_USE_STATIC_RUNTIME=OFF
-DZSTD_ZLIB_SUPPORT=OFF
)
ExternalProject_Add(external_zstd
URL file://${PACKAGE_DIR}/${ZSTD_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ZSTD_HASH_TYPE}=${ZSTD_HASH}
PREFIX ${BUILD_DIR}/zstd
SOURCE_SUBDIR build/cmake
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/zstd ${DEFAULT_CMAKE_FLAGS} ${ZSTD_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/zstd
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_zstd after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zstd/lib/zstd_static${LIBEXT} ${HARVEST_TARGET}/zstd/lib/zstd_static${LIBEXT}
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zstd/include/ ${HARVEST_TARGET}/zstd/include/
DEPENDEES install
)
endif()
endif()