Skip to content

Commit 675e916

Browse files
committed
Fix Freetype mess, MinGW native gamelogic build
06453a8 does a regression of finding Freetype (and populating the variables) only if "NOT BUILD_CLIENT". We always need to find and set it regardless of what happened in Daemon's CMakeLists! It still worked sometimes because rmlui.cmake had a duplicate call to find_package(Freetype). But rmlui.cmake does not link zlib which is supposed to be a dependency of the external_deps Freetype builds used on Windows and Mac. Note: with some toolchains the build can succeed even if the zlib dependency is not provided. This happens with Visual Studio and I've seen it on Mac too. I think it must depend on whether the linker removes unused symbols or resolves dependencies first. For MinGW you actually have to link zlib to build.
1 parent d1e31f3 commit 675e916

2 files changed

Lines changed: 5 additions & 17 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,12 @@ set(NACL_VM_INHERITED_OPTIONS ${NACL_VM_INHERITED_OPTIONS} RC_MAX_LAYERS RC_MAX_
9999

100100
if (BUILDING_ANY_GAMELOGIC)
101101
if (BUILD_CGAME)
102-
# Freetype (RmlUi dependency), already found for a native game when the client is built.
103-
if (NACL)
104-
include(${DAEMON_DIR}/freetype.cmake)
105-
elseif (NOT BUILD_CLIENT)
106-
prefer_package(Freetype ${DAEMON_DIR}/freetype.cmake)
107-
108-
if (Freetype_FOUND AND (APPLE OR WIN32))
109-
find_package(ZLIB REQUIRED)
110-
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ${ZLIB_LIBRARIES})
111-
endif()
102+
# Freetype (RmlUi dependency)
103+
prefer_package(Freetype ${DAEMON_DIR}/freetype.cmake)
104+
if (Freetype_FOUND AND (APPLE OR WIN32))
105+
find_package(ZLIB REQUIRED)
106+
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ${ZLIB_LIBRARIES})
112107
endif()
113-
114108
include_directories(${FREETYPE_INCLUDE_DIRS})
115109

116110
# RmlUi

rmlui.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,6 @@ set_source_files_properties(
566566
${RMLUI_DIR}/Source/Core/SystemInterface.cpp # includes windows.h
567567
PROPERTIES SKIP_UNITY_BUILD_INCLUSION 1)
568568

569-
if (NOT FREETYPE_INCLUDE_DIRS)
570-
find_package(Freetype REQUIRED)
571-
endif()
572-
573-
include_directories(${FREETYPE_INCLUDE_DIRS})
574-
575569
set(RMLUI_INCLUDE_DIRS ${RMLUI_DIR}/Include)
576570

577571
include_directories(${RMLUI_INCLUDE_DIRS})

0 commit comments

Comments
 (0)