diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-11-12 11:10:25 -0800 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-19 10:48:48 -0800 |
| commit | 377fde5cf1ad8aa31c8731efabad13c1b49dbee2 (patch) | |
| tree | ab521260df46a1de1d25f1cfcb3645fd07c5a26e /unittests | |
| parent | 8b3a35d5c24816dc0fcdc7145d0911d032a35361 (diff) | |
| download | meson-377fde5cf1ad8aa31c8731efabad13c1b49dbee2.tar.gz | |
linkers: Store a reference to the Environment in the DynamicLinker
For the same reason that the StaticLinker needs this, we need it in the
DynamicLinker as well.
Diffstat (limited to 'unittests')
| -rw-r--r-- | unittests/internaltests.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/unittests/internaltests.py b/unittests/internaltests.py index a1c18efba..8a3e2fd2e 100644 --- a/unittests/internaltests.py +++ b/unittests/internaltests.py @@ -214,9 +214,10 @@ class InternalTests(unittest.TestCase): def test_compiler_args_class_visualstudio(self): - linker = linkers.MSVCDynamicLinker(MachineChoice.HOST, []) + env = get_fake_env() + linker = linkers.MSVCDynamicLinker(env, MachineChoice.HOST, []) # Version just needs to be > 19.0.0 - cc = VisualStudioCPPCompiler([], [], '20.00', MachineChoice.HOST, get_fake_env(), 'x64', linker=linker) + cc = VisualStudioCPPCompiler([], [], '20.00', MachineChoice.HOST, env, 'x64', linker=linker) a = cc.compiler_args(cc.get_always_args()) self.assertEqual(a.to_native(copy=True), ['/nologo', '/showIncludes', '/utf-8', '/Zc:__cplusplus']) @@ -236,8 +237,9 @@ class InternalTests(unittest.TestCase): def test_compiler_args_class_gnuld(self): ## Test --start/end-group - linker = linkers.GnuBFDDynamicLinker([], MachineChoice.HOST, '-Wl,', []) - gcc = GnuCCompiler([], [], 'fake', MachineChoice.HOST, get_fake_env(), linker=linker) + env = get_fake_env() + linker = linkers.GnuBFDDynamicLinker([], env, MachineChoice.HOST, '-Wl,', []) + gcc = GnuCCompiler([], [], 'fake', MachineChoice.HOST, env, linker=linker) ## Ensure that the fake compiler is never called by overriding the relevant function gcc.get_default_include_dirs = lambda: ['/usr/include', '/usr/share/include', '/usr/local/include'] ## Test that 'direct' append and extend works @@ -264,8 +266,9 @@ class InternalTests(unittest.TestCase): def test_compiler_args_remove_system(self): ## Test --start/end-group - linker = linkers.GnuBFDDynamicLinker([], MachineChoice.HOST, '-Wl,', []) - gcc = GnuCCompiler([], [], 'fake', MachineChoice.HOST, get_fake_env(), linker=linker) + env = get_fake_env() + linker = linkers.GnuBFDDynamicLinker([], env, MachineChoice.HOST, '-Wl,', []) + gcc = GnuCCompiler([], [], 'fake', MachineChoice.HOST, env, linker=linker) ## Ensure that the fake compiler is never called by overriding the relevant function gcc.get_default_include_dirs = lambda: ['/usr/include', '/usr/share/include', '/usr/local/include'] ## Test that 'direct' append and extend works |
