From b510bc12ac55ffd074b32136802f59f599e14b9e Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 15 Apr 2019 11:43:03 -0700 Subject: [PATCH] Shaderc pkg config --- mesonbuild/dependencies/misc.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 29149aa5f..55cb56939 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -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