Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2021-07-15 03:22:23 +0300
committerRay Molenkamp <github@lazydodo.com>2021-07-15 03:22:23 +0300
commit4be166b6b582a428abff90b87005d404f45c9ca0 (patch)
treeb1ac73d8d908d8afc05ecdc44400ef789e03b5e3 /build_files/build_environment
parent4e65b1ef6cdaa0fbe6bac1d1f4a54da4d3247584 (diff)
deps_builder: zstd 1.5.0
Having zstd available is a requirement for landing D5799 Reviewed By: sybren Differential Revision: https://developer.blender.org/D11079
Diffstat (limited to 'build_files/build_environment')
-rw-r--r--build_files/build_environment/CMakeLists.txt1
-rw-r--r--build_files/build_environment/cmake/download.cmake1
-rw-r--r--build_files/build_environment/cmake/harvest.cmake2
-rw-r--r--build_files/build_environment/cmake/versions.cmake6
-rw-r--r--build_files/build_environment/cmake/zstd.cmake52
5 files changed, 62 insertions, 0 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index 62b4602a998..8c739dcd68e 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -56,6 +56,7 @@ else()
endif()
include(cmake/zlib.cmake)
+include(cmake/zstd.cmake)
include(cmake/openal.cmake)
include(cmake/png.cmake)
include(cmake/jpeg.cmake)
diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake
index db90e9b40e9..b4d96ea856f 100644
--- a/build_files/build_environment/cmake/download.cmake
+++ b/build_files/build_environment/cmake/download.cmake
@@ -92,3 +92,4 @@ download_source(ISPC)
download_source(GMP)
download_source(POTRACE)
download_source(HARU)
+download_source(ZSTD)
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
index b94790507b2..a19c332457d 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -192,6 +192,8 @@ harvest(potrace/include potrace/include "*.h")
harvest(potrace/lib potrace/lib "*.a")
harvest(haru/include haru/include "*.h")
harvest(haru/lib haru/lib "*.a")
+harvest(zstd/include zstd/include "*.h")
+harvest(zstd/lib zstd/lib "*.a")
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*.so*")
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index bb0ee961f05..a71fc4b85e4 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -500,5 +500,11 @@ set(HARU_HASH 4f916aa49c3069b3a10850013c507460)
set(HARU_HASH_TYPE MD5)
set(HARU_FILE libharu-${HARU_VERSION}.tar.gz)
+set(ZSTD_VERSION 1.5.0)
+set(ZSTD_URI https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz)
+set(ZSTD_HASH 5194fbfa781fcf45b98c5e849651aa7b3b0a008c6b72d4a0db760f3002291e94)
+set(ZSTD_HASH_TYPE SHA256)
+set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz)
+
set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git)
set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525)
diff --git a/build_files/build_environment/cmake/zstd.cmake b/build_files/build_environment/cmake/zstd.cmake
new file mode 100644
index 00000000000..87b19786f9b
--- /dev/null
+++ b/build_files/build_environment/cmake/zstd.cmake
@@ -0,0 +1,52 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+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()
+