Skip to content

Commit

Permalink
Linux: Relax interdependency between freetype, libpng, and zlib for u…
Browse files Browse the repository at this point in the history
…nvendored builds

This restriction was added to fix godotengine#7373 back then, which was a symbol conflict
between FreeType's bundled copy of gzip/zlib, and distro packages.

But we also unbundled FreeType's zlib in godotengine#69395 so this is no longer an issue.
  • Loading branch information
akien-mga committed Dec 5, 2024
1 parent 1f47e4c commit 99d7352
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
2 changes: 1 addition & 1 deletion modules/freetype/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if env["builtin_freetype"]:
env.Prepend(CPPPATH=[thirdparty_dir + "/include"])

env_freetype.Append(CPPDEFINES=["FT2_BUILD_LIBRARY", "FT_CONFIG_OPTION_USE_PNG", "FT_CONFIG_OPTION_SYSTEM_ZLIB"])
if env.dev_build:
if env.dev_build and env["builtin_zlib"]: # Should match what we set in core/SCsub
env_freetype.Append(CPPDEFINES=["ZLIB_DEBUG"])

# Also requires libpng headers
Expand Down
17 changes: 0 additions & 17 deletions platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,6 @@ def configure(env: "SConsEnvironment"):

# FIXME: Check for existence of the libs before parsing their flags with pkg-config

# freetype depends on libpng and zlib, so bundling one of them while keeping others
# as shared libraries leads to weird issues. And graphite and harfbuzz need freetype.
ft_linked_deps = [
env["builtin_freetype"],
env["builtin_libpng"],
env["builtin_zlib"],
env["builtin_graphite"],
env["builtin_harfbuzz"],
]
if (not all(ft_linked_deps)) and any(ft_linked_deps): # All or nothing.
print_error(
"These libraries should be either all builtin, or all system provided:\n"
"freetype, libpng, zlib, graphite, harfbuzz.\n"
"Please specify `builtin_<name>=no` for all of them, or none."
)
sys.exit(255)

if not env["builtin_freetype"]:
env.ParseConfig("pkg-config freetype2 --cflags --libs")

Expand Down

0 comments on commit 99d7352

Please sign in to comment.