diff options
author | Ray Molenkamp <github@lazydodo.com> | 2022-01-21 20:26:05 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2022-01-21 20:26:05 +0300 |
commit | c20f209b1c3e94f26984d8136a38ee1927ce3427 (patch) | |
tree | 9fb705c0b60824b1f6a4e409c67e79b2d3bd43f7 /build_files/build_environment/cmake | |
parent | 59fc95bf97e70cd8daa86e9300f7e277ff2bb7b4 (diff) |
Cmake/Deps: Freetype 2.11.0 / brotli 1.0.9
The UI team requested adding woff2 support to freetype.
this required a new dependency brotli.
This changes adds brotili to the builder and bumps
freetype to version 2.11.0
As freetype now depends on other libraries, for consistency
all use of ${FREETYPE_LIBRARY} in cmake has been updated to
use ${FREETYPE_LIBRARIES} adjustments have been made in the
windows platform file, all other platforms use cmake's
FindFreeType.cmake which already sets this variable.
reviewed by: brecht
Differential Revision: https://developer.blender.org/D13448
Diffstat (limited to 'build_files/build_environment/cmake')
-rw-r--r-- | build_files/build_environment/cmake/brotli.cmake | 38 | ||||
-rw-r--r-- | build_files/build_environment/cmake/download.cmake | 1 | ||||
-rw-r--r-- | build_files/build_environment/cmake/freetype.cmake | 10 | ||||
-rw-r--r-- | build_files/build_environment/cmake/harvest.cmake | 2 | ||||
-rw-r--r-- | build_files/build_environment/cmake/versions.cmake | 11 |
5 files changed, 59 insertions, 3 deletions
diff --git a/build_files/build_environment/cmake/brotli.cmake b/build_files/build_environment/cmake/brotli.cmake new file mode 100644 index 00000000000..24fdeae15af --- /dev/null +++ b/build_files/build_environment/cmake/brotli.cmake @@ -0,0 +1,38 @@ +# ***** 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(BROTLI_EXTRA_ARGS +) + +ExternalProject_Add(external_brotli + URL file://${PACKAGE_DIR}/${BROTLI_FILE} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH ${BROTLI_HASH_TYPE}=${BROTLI_HASH} + PREFIX ${BUILD_DIR}/brotli + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/brotli ${DEFAULT_CMAKE_FLAGS} ${BROTLI_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/brotli +) + +if(BUILD_MODE STREQUAL Release AND WIN32) + ExternalProject_Add_Step(external_brotli after_install + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/brotli/include ${HARVEST_TARGET}/brotli/include + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlidec-static${LIBEXT} ${HARVEST_TARGET}/zstd/lib/brotlidec-static${LIBEXT} + COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlicommon-static${LIBEXT} ${HARVEST_TARGET}/zstd/lib/brotlicommon-static${LIBEXT} + DEPENDEES install + ) +endif() diff --git a/build_files/build_environment/cmake/download.cmake b/build_files/build_environment/cmake/download.cmake index 2a84202ea02..d3a4d767c08 100644 --- a/build_files/build_environment/cmake/download.cmake +++ b/build_files/build_environment/cmake/download.cmake @@ -94,3 +94,4 @@ download_source(POTRACE) download_source(HARU) download_source(ZSTD) download_source(FLEX) +download_source(BROTLI) diff --git a/build_files/build_environment/cmake/freetype.cmake b/build_files/build_environment/cmake/freetype.cmake index 49a83cb3377..52261b47618 100644 --- a/build_files/build_environment/cmake/freetype.cmake +++ b/build_files/build_environment/cmake/freetype.cmake @@ -23,9 +23,12 @@ set(FREETYPE_EXTRA_ARGS -DWITH_HarfBuzz=OFF -DFT_WITH_HARFBUZZ=OFF -DFT_WITH_BZIP2=OFF + -DFT_WITH_BROTLI=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE) + -DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include + -DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib + ) ExternalProject_Add(external_freetype URL file://${PACKAGE_DIR}/${FREETYPE_FILE} @@ -36,6 +39,11 @@ ExternalProject_Add(external_freetype INSTALL_DIR ${LIBDIR}/freetype ) +add_dependencies( + external_freetype + external_brotli +) + if(BUILD_MODE STREQUAL Release AND WIN32) ExternalProject_Add_Step(external_freetype after_install COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index 4d06430ea49..0e68e720b44 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -79,6 +79,8 @@ endfunction() harvest(alembic/include alembic/include "*.h") harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a) harvest(alembic/bin alembic/bin "*") +harvest(brotli/include brotli/include "*.h") +harvest(brotli/lib brotli/lib "*.a") harvest(boost/include boost/include "*") harvest(boost/lib boost/lib "*.a") harvest(ffmpeg/include ffmpeg/include "*.h") diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake index c758dbd265e..cc811cef06f 100644 --- a/build_files/build_environment/cmake/versions.cmake +++ b/build_files/build_environment/cmake/versions.cmake @@ -83,9 +83,9 @@ else() set(OPENEXR_VERSION_POSTFIX) endif() -set(FREETYPE_VERSION 2.10.2) +set(FREETYPE_VERSION 2.11.0) set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz) -set(FREETYPE_HASH b1cb620e4c875cd4d1bfa04945400945) +set(FREETYPE_HASH cf09172322f6b50cf8f568bf8fe14bde) set(FREETYPE_HASH_TYPE MD5) set(FREETYPE_FILE freetype-${FREETYPE_VERSION}.tar.gz) @@ -500,3 +500,10 @@ set(ZSTD_FILE zstd-${ZSTD_VERSION}.tar.gz) set(SSE2NEON_GIT https://github.com/DLTcollab/sse2neon.git) set(SSE2NEON_GIT_HASH fe5ff00bb8d19b327714a3c290f3e2ce81ba3525) + +set(BROTLI_VERSION v1.0.9) +set(BROTLI_URI https://github.com/google/brotli/archive/refs/tags/${BROTLI_VERSION}.tar.gz) +set(BROTLI_HASH f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46) +set(BROTLI_HASH_TYPE SHA256) +set(BROTLI_FILE brotli-${BROTLI_VERSION}.tar.gz) + |