diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-10-21 14:45:37 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-10-21 14:46:33 +0300 |
commit | a5917175d8c1a7cab83b401ae2f4affcd4ab8df4 (patch) | |
tree | 353010c4089a3a8bf29efa27b4d9e31d4a71d42a /build_files/build_environment/cmake | |
parent | 417ce7ffc1bbb9da15e82b6b81537bc86831f21c (diff) |
Deps: Python, bundle zstandard package
This package allows Python scripts to handle compressed blend files (see
rB2ea66af742bc). This is for example needed by Blender Asset Tracer to
send files to a Flamenco render farm.
This change includes a new `WITH_PYTHON_INSTALL_ZSTANDARD` build-time
option, to control whether to actually install the package. For this the
already-existing approach for Requests was copied.
Reviewed By: LazyDodo, mont29, brecht
Differential Revision: https://developer.blender.org/D12777
Diffstat (limited to 'build_files/build_environment/cmake')
-rw-r--r-- | build_files/build_environment/cmake/python_site_packages.cmake | 10 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/build_files/build_environment/cmake/python_site_packages.cmake b/build_files/build_environment/cmake/python_site_packages.cmake index 6bc47fa5c45..a8918fdb784 100644 --- a/build_files/build_environment/cmake/python_site_packages.cmake +++ b/build_files/build_environment/cmake/python_site_packages.cmake @@ -18,14 +18,20 @@ if(WIN32 AND BUILD_MODE STREQUAL Debug) set(SITE_PACKAGES_EXTRA --global-option build --global-option --debug) + # zstandard is determined to build and link release mode libs in a debug + # configuration, the only way to make it happy is to bend to its will + # and give it a library to link with. + set(PIP_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.lib ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib) +else() + set(PIP_CONFIGURE_COMMAND echo ".") endif() ExternalProject_Add(external_python_site_packages DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND "" + CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND} BUILD_COMMAND "" PREFIX ${BUILD_DIR}/site_packages - INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all: + INSTALL_COMMAND ${PYTHON_BINARY} -m pip install ${SITE_PACKAGES_EXTRA} cython==${CYTHON_VERSION} idna==${IDNA_VERSION} charset-normalizer==${CHARSET_NORMALIZER_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} zstandard==${ZSTANDARD_VERSION} --no-binary :all: ) if(USE_PIP_NUMPY) diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index ec83de4866f..f2c245dc380 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -221,6 +221,7 @@ set(URLLIB3_VERSION 1.26.7) set(CERTIFI_VERSION 2021.10.8) set(REQUESTS_VERSION 2.26.0) set(CYTHON_VERSION 0.29.24) +set(ZSTANDARD_VERSION 0.15.2 ) set(NUMPY_VERSION 1.21.2) set(NUMPY_SHORT_VERSION 1.21) |