Use pkg-config to determine static linking dependencies, default to original behaviour.

This commit is contained in:
Artem Pavlenko 2024-04-04 11:01:17 +01:00
parent c2c6d2ed60
commit 0708ee8724

View file

@ -91,9 +91,13 @@ if '-DHAVE_TIFF' in env['CPPDEFINES']:
enabled_imaging_libraries.append('tiff_reader.cpp') enabled_imaging_libraries.append('tiff_reader.cpp')
if '-DHAVE_WEBP' in env['CPPDEFINES']: if '-DHAVE_WEBP' in env['CPPDEFINES']:
lib_env['LIBS'].append('webp') cmd="pkg-config libwebp --libs"
if env['RUNTIME_LINK'] == 'static': if env['RUNTIME_LINK'] == 'static':
lib_env['LIBS'].append('sharpyuv'); cmd += " --static"
try:
lib_env.ParseConfig(cmd)
except:
lib_env['LIBS'].append('webp')
enabled_imaging_libraries.append('webp_reader.cpp') enabled_imaging_libraries.append('webp_reader.cpp')
enabled_imaging_libraries.append('webp_io.cpp') enabled_imaging_libraries.append('webp_io.cpp')