freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 395da3d72: CMakeLists.txt (FT_ENABLE_ERROR_STRINGS):


From: Werner Lemberg
Subject: [freetype2] master 395da3d72: CMakeLists.txt (FT_ENABLE_ERROR_STRINGS): New configuration option.
Date: Sun, 21 Aug 2022 14:01:03 -0400 (EDT)

branch: master
commit 395da3d72ac5186fdf68fb450bba1d57515fce1e
Author: Sean Farrell <sean.farrell@rioki.org>
Commit: Werner Lemberg <wl@gnu.org>

    CMakeLists.txt (FT_ENABLE_ERROR_STRINGS): New configuration option.
    
    This option uncomments FreeType configuration macro
    `FT_CONFIG_OPTION_ERROR_STRINGS` to make function `FT_Error_String` return
    meaningful error strings.
    
    This option is off by default.
---
 CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index feb4be39a..dff5b4ef5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,8 @@
 #
 # Some notes.
 #
+# - Say `cmake -LAH` to see all configuration options.
+#
 # - `cmake' creates configuration files in
 #
 #     <build-directory>/include/freetype/config
@@ -215,6 +217,8 @@ cmake_dependent_option(FT_REQUIRE_BROTLI
   "Require support of compressed WOFF2 fonts." OFF
   "NOT FT_DISABLE_BROTLI" OFF)
 
+option(FT_ENABLE_ERROR_STRINGS
+  "Enable support for meaningful error descriptions." OFF)
 
 # Disallow in-source builds
 if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
@@ -354,6 +358,12 @@ if (BROTLIDEC_FOUND)
     FTOPTION_H "${FTOPTION_H}")
 endif ()
 
+if (FT_ENABLE_ERROR_STRINGS)
+  string(REGEX REPLACE
+    "/\\* +(#define +FT_CONFIG_OPTION_ERROR_STRINGS) +\\*/" "\\1"
+    FTOPTION_H "${FTOPTION_H}")
+endif ()
+
 set(FTOPTION_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
 if (EXISTS "${FTOPTION_H_NAME}")
   file(READ "${FTOPTION_H_NAME}" ORIGINAL_FTOPTION_H)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]