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:
authorSebastian Parborg <darkdefende@gmail.com>2022-08-02 15:48:05 +0300
committerSebastian Parborg <darkdefende@gmail.com>2022-08-02 15:50:38 +0300
commit0830320a7ce8da31dec7c1efd97a7481784b6445 (patch)
tree3f51063122e17145fe11bfe40dc60f8867f08086 /build_files/cmake
parent25a0124bc890a3390ef7738707f218f50a8d8ac3 (diff)
CMake: Check if freetype is compiled with brotli support
Because of the recent changes to our core fonts, Freetype has to support Woff2 fonts or Blender will segfault on startup. This adds an explicit check for this to inform people compiling Blender about this requirement.
Diffstat (limited to 'build_files/cmake')
-rw-r--r--build_files/cmake/platform/platform_unix.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index f6e233a0c86..406748b7ff0 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -96,6 +96,18 @@ find_package_wrapper(PNG REQUIRED)
find_package_wrapper(ZLIB REQUIRED)
find_package_wrapper(Zstd REQUIRED)
+function(check_freetype_for_brotli)
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_INCLUDES ${FREETYPE_INCLUDE_DIRS})
+ check_symbol_exists(FT_CONFIG_OPTION_USE_BROTLI
+ "freetype/config/ftconfig.h" HAVE_BROTLI)
+ if(NOT HAVE_BROTLI)
+ unset(HAVE_BROTLI CACHE)
+ message(FATAL_ERROR "Freetype needs to be compiled with brotli support!")
+ endif()
+ unset(HAVE_BROTLI CACHE)
+endfunction()
+
if(NOT WITH_SYSTEM_FREETYPE)
# FreeType compiled with Brotli compression for woff2.
find_package_wrapper(Freetype REQUIRED)
@@ -110,6 +122,7 @@ if(NOT WITH_SYSTEM_FREETYPE)
# ${BROTLI_LIBRARIES}
# )
endif()
+ check_freetype_for_brotli()
endif()
if(WITH_PYTHON)
@@ -587,6 +600,7 @@ if(WITH_SYSTEM_FREETYPE)
if(NOT FREETYPE_FOUND)
message(FATAL_ERROR "Failed finding system FreeType version!")
endif()
+ check_freetype_for_brotli()
endif()
if(WITH_LZO AND WITH_SYSTEM_LZO)