diff options
author | Marvin Scholz <epirat07@gmail.com> | 2019-06-13 00:07:13 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-07-05 22:27:10 +0300 |
commit | 5badc3912d266dc0d619812429f3d8d411c83b54 (patch) | |
tree | bbbc246ff2438bd9c001ca62eccf189c796608e6 /mesonbuild/compilers | |
parent | 976c30360370354cdfd3222e6fb9e2e595b2a4c8 (diff) | |
download | meson-5badc3912d266dc0d619812429f3d8d411c83b54.zip meson-5badc3912d266dc0d619812429f3d8d411c83b54.tar.gz meson-5badc3912d266dc0d619812429f3d8d411c83b54.tar.bz2 |
compilers: Add missing cflags when calling compiler in link mode
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/clike.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/mesonbuild/compilers/clike.py b/mesonbuild/compilers/clike.py index 49fb846..9cadfdc 100644 --- a/mesonbuild/compilers/clike.py +++ b/mesonbuild/compilers/clike.py @@ -384,16 +384,17 @@ class CLikeCompiler: # Select a CRT if needed since we're linking if mode == 'link': args += self.get_linker_debug_crt_args() - if mode in {'compile', 'preprocess'}: - # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS and CPPFLAGS from the env - sys_args = env.coredata.get_external_args(self.for_machine, self.language) - # Apparently it is a thing to inject linker flags both - # via CFLAGS _and_ LDFLAGS, even though the former are - # also used during linking. These flags can break - # argument checks. Thanks, Autotools. - cleaned_sys_args = self.remove_linkerlike_args(sys_args) - args += cleaned_sys_args - elif mode == 'link': + + # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS and CPPFLAGS from the env + sys_args = env.coredata.get_external_args(self.for_machine, self.language) + # Apparently it is a thing to inject linker flags both + # via CFLAGS _and_ LDFLAGS, even though the former are + # also used during linking. These flags can break + # argument checks. Thanks, Autotools. + cleaned_sys_args = self.remove_linkerlike_args(sys_args) + args += cleaned_sys_args + + if mode == 'link': # Add LDFLAGS from the env args += env.coredata.get_external_link_args(self.for_machine, self.language) |