aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-04-28 23:47:15 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2019-05-02 21:37:57 +0300
commit7ac03f62646d40b31b9c1ef1b4f6778c788ec90a (patch)
treeac7220623ed8e98efb16ca94cd01cacaf7b1f715
parent4c2617a9c6fd02e3f8831b7de8755380ac4bcb16 (diff)
downloadmeson-7ac03f62646d40b31b9c1ef1b4f6778c788ec90a.zip
meson-7ac03f62646d40b31b9c1ef1b4f6778c788ec90a.tar.gz
meson-7ac03f62646d40b31b9c1ef1b4f6778c788ec90a.tar.bz2
Non-required appleframework deps should not be an error. Closes #5295.
-rw-r--r--mesonbuild/dependencies/platform.py13
-rw-r--r--mesonbuild/interpreter.py1
-rw-r--r--test cases/objc/2 nsstring/meson.build3
3 files changed, 15 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/platform.py b/mesonbuild/dependencies/platform.py
index 9863fb1..e913ed4 100644
--- a/mesonbuild/dependencies/platform.py
+++ b/mesonbuild/dependencies/platform.py
@@ -16,7 +16,7 @@
# platform-specific (generally speaking).
from .base import ExternalDependency, DependencyException
-
+from ..mesonlib import MesonException
class AppleFrameworks(ExternalDependency):
def __init__(self, env, kwargs):
@@ -31,7 +31,16 @@ class AppleFrameworks(ExternalDependency):
raise DependencyException('No C-like compilers are available, cannot find the framework')
self.is_found = True
for f in self.frameworks:
- args = self.clib_compiler.find_framework(f, env, [])
+ try:
+ args = self.clib_compiler.find_framework(f, env, [])
+ except MesonException as e:
+ if 'non-clang' in str(e):
+ self.is_found = False
+ self.link_args = []
+ self.compile_args = []
+ return
+ raise
+
if args is not None:
# No compile args are needed for system frameworks
self.link_args += args
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 8ca7758..a3505a4 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2996,6 +2996,7 @@ external dependencies (including libraries) must go to "dependencies".''')
self._handle_featurenew_dependencies(name)
kwargs['required'] = required and not has_fallback
dep = dependencies.find_external_dependency(name, self.environment, kwargs)
+
kwargs['required'] = required
# Only store found-deps in the cache
# Never add fallback deps to self.coredata.deps since we
diff --git a/test cases/objc/2 nsstring/meson.build b/test cases/objc/2 nsstring/meson.build
index 7f2483f..94d2cf1 100644
--- a/test cases/objc/2 nsstring/meson.build
+++ b/test cases/objc/2 nsstring/meson.build
@@ -15,3 +15,6 @@ else
endif
exe = executable('stringprog', 'stringprog.m', dependencies : dep)
test('stringtest', exe)
+
+# Ensure that a non-required dep that is not found does not cause an error
+dependency('appleframeworks', modules: 'nonexisting', required: false)