Skip to content

Commit d945c4e

Browse files
committed
x11: Improve logic for cross-dependencies between freetype, zlib and libpng
Fixes #7373.
1 parent ede36ac commit d945c4e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

platform/x11/detect.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ def configure(env):
139139
if (env['builtin_libwebp'] == 'no'):
140140
env.ParseConfig('pkg-config libwebp --cflags --libs')
141141

142+
# freetype depends on libpng and zlib, so bundling one of them while keeping others
143+
# as shared libraries leads to weird issues
144+
if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'):
145+
env['builtin_freetype'] = 'yes'
146+
env['builtin_libpng'] = 'yes'
147+
env['builtin_zlib'] = 'yes'
148+
142149
if (env['builtin_freetype'] == 'no'):
143150
env.ParseConfig('pkg-config freetype2 --cflags --libs')
144151

@@ -203,10 +210,14 @@ def configure(env):
203210
else:
204211
print("PulseAudio development libraries not found, disabling driver")
205212

213+
if (env['builtin_zlib'] == 'no'):
214+
env.ParseConfig('pkg-config zlib --cflags --libs')
215+
206216
env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
207-
env.Append(LIBS=['GL', 'pthread', 'z'])
217+
env.Append(LIBS=['GL', 'pthread'])
218+
208219
if (platform.system() == "Linux"):
209-
env.Append(LIBS='dl')
220+
env.Append(LIBS=['dl'])
210221
# env.Append(CPPFLAGS=['-DMPC_FIXED_POINT'])
211222

212223
# host compiler is default..

0 commit comments

Comments
 (0)