diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-11-12 10:05:11 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-19 10:48:48 -0800 |
| commit | 0e6fd84db2299b45d9abbe42cb461fa7e49b27c3 (patch) | |
| tree | 5c33b2030593ada2b55d26e5fa48852ad89bc621 /mesonbuild/compilers/cpp.py | |
| parent | 198156295899ddb5e9c91f1c889d50f27e8a7692 (diff) | |
| download | meson-0e6fd84db2299b45d9abbe42cb461fa7e49b27c3.tar.gz | |
compilers: Remove Environment parameter from Compiler.get_language_stdlib_only_link_flags
Diffstat (limited to 'mesonbuild/compilers/cpp.py')
| -rw-r--r-- | mesonbuild/compilers/cpp.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 5f97c566a..233a28b63 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -190,7 +190,7 @@ class _StdCPPLibMixin(CompilerMixinBase): return lib @functools.lru_cache(None) - def language_stdlib_only_link_flags(self, env: Environment) -> T.List[str]: + def language_stdlib_only_link_flags(self) -> T.List[str]: """Detect the C++ stdlib and default search dirs As an optimization, this method will cache the value, to avoid building the same values over and over @@ -203,13 +203,10 @@ class _StdCPPLibMixin(CompilerMixinBase): # be passed to a different compiler with a different set of default # search paths, such as when using Clang for C/C++ and gfortran for # fortran. - search_dirs = [f'-L{d}' for d in self.get_compiler_dirs(env, 'libraries')] + search_dirs = [f'-L{d}' for d in self.get_compiler_dirs(self.environment, 'libraries')] - machine = env.machines[self.for_machine] - assert machine is not None, 'for mypy' - - lib = self.language_stdlib_provider(env) - if self.find_library(lib, env, []) is not None: + lib = self.language_stdlib_provider(self.environment) + if self.find_library(lib, self.environment, []) is not None: return search_dirs + [f'-l{lib}'] # TODO: maybe a bug exception? |
