Non-required appleframework deps should not be an error. Closes #5295.

pull/5254/head
Jussi Pakkanen 6 years ago
parent 4c2617a9c6
commit 7ac03f6264
  1. 13
      mesonbuild/dependencies/platform.py
  2. 1
      mesonbuild/interpreter.py
  3. 3
      test cases/objc/2 nsstring/meson.build

@ -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

@ -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

@ -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)

Loading…
Cancel
Save