From 388a166203f5548979b5598c25c17bcc9abe251d Mon Sep 17 00:00:00 2001 From: Diomendius <42310725+Diomendius@users.noreply.github.com> Date: Sun, 16 Jun 2024 23:18:53 +1200 Subject: [PATCH] Add GpFontHandler_FreeType2 to CMake Also add stddef.h include to GpRenderedGlyphMetrics.h to make size_t visible. Does MSVC provide size_t by default, or via stdint.h? This prevents compilation and I can't see how this would have compiled on Windows otherwise. --- CMakeLists.txt | 16 ++++++++++++++++ GpCommon/GpRenderedGlyphMetrics.h | 1 + 2 files changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc6881b..d32d328 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,4 +427,20 @@ target_include_directories(unpacktool PRIVATE target_link_libraries(unpacktool PortabilityLayer MacRomanConversion) +find_package(Freetype) +if(FREETYPE_FOUND) + add_library(GpFontHandler_FreeType2 STATIC + GpFontHandler_FreeType2/GpFontHandler_FreeType2.cpp + ) + + target_include_directories(GpFontHandler_FreeType2 PRIVATE + Common + GpCommon + "${FREETYPE_INCLUDE_DIR_ft2build}" + ) + + target_link_libraries(GpFontHandler_FreeType2 PRIVATE Freetype::Freetype) +endif() + + install (TARGETS ${EXECNAME}) diff --git a/GpCommon/GpRenderedGlyphMetrics.h b/GpCommon/GpRenderedGlyphMetrics.h index 91415a8..584d5cb 100644 --- a/GpCommon/GpRenderedGlyphMetrics.h +++ b/GpCommon/GpRenderedGlyphMetrics.h @@ -1,5 +1,6 @@ #pragma once +#include #include struct GpRenderedGlyphMetrics