compilers: Add missing cflags when calling compiler in link mode
@@ -384,7 +384,7 @@ 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
@@ -393,7 +393,8 @@ class CLikeCompiler:
# argument checks. Thanks, Autotools.
cleaned_sys_args = self.remove_linkerlike_args(sys_args)
args += cleaned_sys_args
- elif mode == 'link':
+
+ if mode == 'link':
# Add LDFLAGS from the env
args += env.coredata.get_external_link_args(self.for_machine, self.language)
