Shaderc pkg config

This commit is contained in:
Dylan Baker 2019-04-15 11:43:03 -07:00 committed by Jussi Pakkanen
parent 3814d698b1
commit b510bc12ac
1 changed files with 16 additions and 3 deletions

View File

@ -735,12 +735,25 @@ class ShadercDependency(ExternalDependency):
methods = cls._process_method_kw(kwargs)
candidates = []
if DependencyMethods.PKGCONFIG in methods:
# ShaderC packages their shared and static libs together
# and provides different pkg-config files for each one. We
# smooth over this difference by handling the static
# keyword before handing off to the pkg-config handler.
shared_libs = ['shaderc']
static_libs = ['shaderc_combined', 'shaderc_static']
if kwargs.get('static', False):
c = [functools.partial(PkgConfigDependency, name, environment, kwargs)
for name in static_libs + shared_libs]
else:
c = [functools.partial(PkgConfigDependency, name, environment, kwargs)
for name in shared_libs + static_libs]
candidates.exend(c)
if DependencyMethods.SYSTEM in methods:
candidates.append(functools.partial(ShadercDependency, environment, kwargs))
if DependencyMethods.PKGCONFIG in methods:
candidates.append(functools.partial(PkgConfigDependency, 'shaderc', environment, kwargs))
return candidates
@staticmethod