diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-01-29 16:12:35 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-01-31 20:36:49 +0000 |
commit | 50b863032ed3913b9737112b5250c2d35a7b9fb7 (patch) | |
tree | 8eb16694963e2a9ea6c0354026e709561ca39730 /mesonbuild/backend | |
parent | 52936e4a4624e87b79bcaa2795751a037104ece0 (diff) | |
download | meson-50b863032ed3913b9737112b5250c2d35a7b9fb7.zip meson-50b863032ed3913b9737112b5250c2d35a7b9fb7.tar.gz meson-50b863032ed3913b9737112b5250c2d35a7b9fb7.tar.bz2 |
find_library: Check arch of libraries on Darwin
macOS provides the tool `lipo` to check the archs supported by an
object (executable, static library, dylib, etc). This is especially
useful for fat archives, but it also helps with thin archives.
Without this, the linker will fail to link to the library we mistakenly
'found' like so:
ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 493fc0d..9b215b2 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2347,15 +2347,14 @@ rule FORTRAN_DEP_HACK%s target_args = self.build_target_link_arguments(linker, target.link_whole_targets) return linker.get_link_whole_for(target_args) if len(target_args) else [] - @staticmethod @lru_cache(maxsize=None) - def guess_library_absolute_path(linker, libname, search_dirs, patterns): + def guess_library_absolute_path(self, linker, libname, search_dirs, patterns): for d in search_dirs: for p in patterns: trial = CCompiler._get_trials_from_pattern(p, d, libname) if not trial: continue - trial = CCompiler._get_file_from_list(trial) + trial = CCompiler._get_file_from_list(self.environment, trial) if not trial: continue # Return the first result |