From a28dde40b5b85c97b2eefee63db62ac49e46ca0c Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 23 Jun 2024 20:58:36 +0200 Subject: 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. --- mesonbuild/cmake/tracetargets.py | 4 ++-- test cases/osx/9 framework recasting/meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mesonbuild/cmake/tracetargets.py b/mesonbuild/cmake/tracetargets.py index aee67ea..5a9d352 100644 --- a/mesonbuild/cmake/tracetargets.py +++ b/mesonbuild/cmake/tracetargets.py @@ -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] diff --git a/test cases/osx/9 framework recasting/meson.build b/test cases/osx/9 framework recasting/meson.build index 2b15843..83fe19e 100644 --- a/test cases/osx/9 framework recasting/meson.build +++ b/test cases/osx/9 framework recasting/meson.build @@ -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) -- cgit v1.1