diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-01-30 15:28:02 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-02-01 00:14:09 +0530 |
commit | c0166355ceef5168b2f7b3c6cbace32e8dbafbb4 (patch) | |
tree | 5ad1f9694597e5d9536d098dbf211537a48b917c /mesonbuild/dependencies/platform.py | |
parent | 8481971ff2459ed34e2acb4ce4bb20d1efe6d215 (diff) | |
download | meson-c0166355ceef5168b2f7b3c6cbace32e8dbafbb4.zip meson-c0166355ceef5168b2f7b3c6cbace32e8dbafbb4.tar.gz meson-c0166355ceef5168b2f7b3c6cbace32e8dbafbb4.tar.bz2 |
Rewrite appleframework and extraframework dependency classes
Instead of only doing a naive filesystem search, also run the linker
so that it can tell us whether the -F path specified actually contains
the framework we're looking for.
Unfortunately, `extraframework` searching is still not 100% correct in
the case when since we want to search in either /Library/Frameworks or
in /System/Library/Frameworks but not in both. The -Z flag disables
searching in those prefixes and would in theory allow this, but then
you cannot force the linker to look in those by manually adding -F
args, so that doesn't work.
Diffstat (limited to 'mesonbuild/dependencies/platform.py')
-rw-r--r-- | mesonbuild/dependencies/platform.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mesonbuild/dependencies/platform.py b/mesonbuild/dependencies/platform.py index c78ebed..20d3bd6 100644 --- a/mesonbuild/dependencies/platform.py +++ b/mesonbuild/dependencies/platform.py @@ -29,11 +29,19 @@ class AppleFrameworks(ExternalDependency): if not modules: raise DependencyException("AppleFrameworks dependency requires at least one module.") self.frameworks = modules - # FIXME: Use self.clib_compiler to check if the frameworks are available + if not self.clib_compiler: + raise DependencyException('No C-like compilers are available, cannot find the framework') + self.is_found = True for f in self.frameworks: - self.link_args += ['-framework', f] - - self.is_found = mesonlib.for_darwin(self.want_cross, self.env) + args = self.clib_compiler.find_framework(f, env, []) + if args is not None: + # No compile args are needed for system frameworks + self.link_args = args + else: + self.is_found = False + + def log_info(self): + return ', '.join(self.frameworks) def log_tried(self): return 'framework' |