diff options
author | Bruce Richardson <bruce.richardson@intel.com> | 2018-08-19 20:41:50 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-08-22 12:24:43 -0700 |
commit | 8c9296e8e6a03a23615082f5155fd2a974136678 (patch) | |
tree | f429d22005e40be4cb63ac3fe5dbc8cc6f45cbe5 /mesonbuild/backend/backends.py | |
parent | 05b54b4767ff9bd14f0c037d0c2b86447a077b66 (diff) | |
download | meson-8c9296e8e6a03a23615082f5155fd2a974136678.zip meson-8c9296e8e6a03a23615082f5155fd2a974136678.tar.gz meson-8c9296e8e6a03a23615082f5155fd2a974136678.tar.bz2 |
find_library: Use _build_wrapper to get library dirs
This means that we will take into account all the flags set in the
cross file when fetching the list of library dirs, which means we
won't incorrectly look for 64-bit libraries when building for 32-bit.
Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com>
Closes https://github.com/mesonbuild/meson/issues/3881
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 7ed97b2..df72eff 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -355,9 +355,9 @@ class Backend: return l, stdlib_args @staticmethod - def _libdir_is_system(libdir, compilers): + def _libdir_is_system(libdir, compilers, env): for cc in compilers.values(): - if libdir in cc.get_library_dirs(): + if libdir in cc.get_library_dirs(env): return True return False @@ -372,7 +372,7 @@ class Backend: # The only link argument is an absolute path to a library file. libpath = la[0] libdir = os.path.dirname(libpath) - if exclude_system and self._libdir_is_system(libdir, target.compilers): + if exclude_system and self._libdir_is_system(libdir, target.compilers, self.environment): # No point in adding system paths. continue # Windows doesn't support rpaths, but we use this function to @@ -612,8 +612,8 @@ class Backend: # Get program and library dirs from all target compilers if isinstance(target, build.BuildTarget): for cc in target.compilers.values(): - paths.update(cc.get_program_dirs()) - paths.update(cc.get_library_dirs()) + paths.update(cc.get_program_dirs(self.environment)) + paths.update(cc.get_library_dirs(self.environment)) return list(paths) def determine_windows_extra_paths(self, target, extra_bdeps, is_cross=False): |