diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-04-15 11:43:03 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-04-15 21:43:03 +0300 |
commit | b510bc12ac55ffd074b32136802f59f599e14b9e (patch) | |
tree | 4ebb7f1dcf9c73ea982796a1c23bbbdb05069d9b | |
parent | 3814d698b14e712e60e63d4e6b0e1df4e127634f (diff) | |
download | meson-b510bc12ac55ffd074b32136802f59f599e14b9e.zip meson-b510bc12ac55ffd074b32136802f59f599e14b9e.tar.gz meson-b510bc12ac55ffd074b32136802f59f599e14b9e.tar.bz2 |
Shaderc pkg config
-rw-r--r-- | mesonbuild/dependencies/misc.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index 29149aa..55cb569 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 |