Recast CMake's IMPORTED_LOCATION into framework flags (#13299)

* Explicitly look for 'OpenAL' with method: 'cmake'

This test was added for testing cmake depenencies,
so no other method must be accepted here, and
the spelling must match FindOpenAL.cmake.

* Resolve frameworks in IMPORTED_LOCATION

The IMPORTED_LOCATION property of CMake targets may contain macOS
framework paths. These must be processed into flags. By putting the
values in the list of targets, they will be processed as if they
appeared in INTERFACE_LINK_LIBRARIES.
pull/12043/merge
Kai Pastor 8 months ago committed by GitHub
parent 9be6e653d4
commit a28dde40b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      mesonbuild/cmake/tracetargets.py
  2. 2
      test cases/osx/9 framework recasting/meson.build

@ -137,9 +137,9 @@ def resolve_cmake_trace_targets(target_name: str,
elif 'IMPORTED_IMPLIB' in tgt.properties:
res.libraries += [x for x in tgt.properties['IMPORTED_IMPLIB'] if x]
elif f'IMPORTED_LOCATION_{cfg}' in tgt.properties:
res.libraries += [x for x in tgt.properties[f'IMPORTED_LOCATION_{cfg}'] if x]
targets += [x for x in tgt.properties[f'IMPORTED_LOCATION_{cfg}'] if x]
elif 'IMPORTED_LOCATION' in tgt.properties:
res.libraries += [x for x in tgt.properties['IMPORTED_LOCATION'] if x]
targets += [x for x in tgt.properties['IMPORTED_LOCATION'] if x]
if 'LINK_LIBRARIES' in tgt.properties:
targets += [x for x in tgt.properties['LINK_LIBRARIES'] if x]

@ -1,5 +1,5 @@
project('framework recasting', 'c', 'cpp')
x = dependency('OpenAL')
x = dependency('OpenAL', method: 'cmake')
y = executable('tt', files('main.cpp'), dependencies: x)

Loading…
Cancel
Save