diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2019-01-08 21:59:50 -0500 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-02-15 09:17:24 -0800 |
commit | d451a4bd97f827bb492fd0c0e357cb20b6056ed9 (patch) | |
tree | fa2b4704bb0132e81b2102ced301b5a7ac51c8de /mesonbuild/compilers/c.py | |
parent | 3e9396f2590372f484149b48bf3f1c108c9111c3 (diff) | |
download | meson-d451a4bd97f827bb492fd0c0e357cb20b6056ed9.zip meson-d451a4bd97f827bb492fd0c0e357cb20b6056ed9.tar.gz meson-d451a4bd97f827bb492fd0c0e357cb20b6056ed9.tar.bz2 |
Remove get_cross_extra_flags
This is no longer needed, we just remove conditionals around it.
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r-- | mesonbuild/compilers/c.py | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index b47be7d..a1a8fb9 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -321,10 +321,7 @@ class CCompiler(Compiler): # on OSX the compiler binary is the same but you need # a ton of compiler flags to differentiate between # arm and x86_64. So just compile. - extra_flags += self.get_cross_extra_flags(environment, link=False) extra_flags += self.get_compile_only_args() - else: - extra_flags += self.get_cross_extra_flags(environment, link=True) # Is a valid executable output for all toolchains and platforms binname += '.exe' # Write binary check source @@ -424,28 +421,25 @@ class CCompiler(Compiler): # Select a CRT if needed since we're linking if mode == 'link': args += self.get_linker_debug_crt_args() - # Read c_args/cpp_args/etc from the cross-info file (if needed) - args += self.get_cross_extra_flags(env, link=(mode == 'link')) - if not self.is_cross: - if env.is_cross_build() and not self.is_cross: - for_machine = MachineChoice.BUILD - else: - for_machine = MachineChoice.HOST - if mode == 'preprocess': - # Add CPPFLAGS from the env. - args += env.coredata.get_external_preprocess_args(for_machine, self.language) - elif mode == 'compile': - # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS from the env - sys_args = env.coredata.get_external_args(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 LDFLAGS from the env - args += env.coredata.get_external_link_args(for_machine, self.language) + if env.is_cross_build() and not self.is_cross: + for_machine = MachineChoice.BUILD + else: + for_machine = MachineChoice.HOST + if mode == 'preprocess': + # Add CPPFLAGS from the env. + args += env.coredata.get_external_preprocess_args(for_machine, self.language) + elif mode == 'compile': + # Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS from the env + sys_args = env.coredata.get_external_args(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 LDFLAGS from the env + args += env.coredata.get_external_link_args(for_machine, self.language) args += self.get_compiler_check_args() # extra_args must override all other arguments, so we add them last args += extra_args @@ -875,8 +869,7 @@ class CCompiler(Compiler): } #endif ''' - args = self.get_cross_extra_flags(env, link=False) - args += self.get_compiler_check_args() + args = self.get_compiler_check_args() n = 'symbols_have_underscore_prefix' with self.compile(code, args, 'compile', want_output=True) as p: if p.returncode != 0: |