From 5672a353682a68cb76a03179739bdec0a2f5cf0e Mon Sep 17 00:00:00 2001
From: Sean Farrell <sean.farrell@rioki.org>
Date: Fri, 19 Aug 2022 15:32:19 +0200
Subject: [PATCH] Adds config support for error strings.

---
 CMakeLists.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index feb4be39a..4eea860e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -215,6 +215,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}")
@@ -353,6 +355,11 @@ if (BROTLIDEC_FOUND)
     "/\\* +(#define +FT_CONFIG_OPTION_USE_BROTLI) +\\*/" "\\1"
     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}")
-- 
2.33.0.windows.2

