Skip to content

Commit d6fdafd

Browse files
committed
cmake: use Freetype internal zlib only with game NaCl build
1 parent dfd770b commit d6fdafd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

freetype.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ set(FREETYPE_DIR ${DAEMON_DIR}/libs/freetype)
22
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_DIR}/include)
33
set(FREETYPE_LIBRARIES freetype)
44

5-
if (PREFER_EXTERNAL_LIBS AND NOT NACL)
6-
set(FREETYPE_INTERNAL_ZLIB OFF)
7-
else()
5+
if (NACL)
6+
# Using Freetype's own zlib prevents the need for a zlib submodule when building the nexe cgame.
87
set(FREETYPE_INTERNAL_ZLIB ON)
8+
else()
9+
# Even if we can build an engine with Freetype using its internal zlib, we better rely on the
10+
# external zlib even if PREFER_EXTERNAL_LIBS is OFF, because then it will avoid zlib duplication
11+
# and share the same zlib between Freetype and the libpng.
12+
set(FREETYPE_INTERNAL_ZLIB OFF)
913
endif()
1014

1115
if (NOT FREETYPE_INTERNAL_ZLIB)

0 commit comments

Comments
 (0)