aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-16 22:32:01 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-11-26 11:24:20 -0500
commit7e1b674704a2afa469797e18fc777ecdd8564b0f (patch)
treee3f1a20398158822ae713b7a31cabf01d736e53e
parentbfd190279ca6e8d08917dde0ff22ba33f6162e45 (diff)
downloadmeson-7e1b674704a2afa469797e18fc777ecdd8564b0f.zip
meson-7e1b674704a2afa469797e18fc777ecdd8564b0f.tar.gz
meson-7e1b674704a2afa469797e18fc777ecdd8564b0f.tar.bz2
Add both native and cross compiler options to option list.
-rw-r--r--mesonbuild/compilers.py30
-rw-r--r--mesonbuild/interpreter.py6
2 files changed, 7 insertions, 29 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index ced2b6f..8f8851f 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -1846,11 +1846,7 @@ class VisualStudioCCompiler(CCompiler):
}
def get_option_link_args(self, options):
- # FIXME: See GnuCCompiler.get_option_link_args
- if 'c_winlibs' in options:
- return options['c_winlibs'].value[:]
- else:
- return msvc_winlibs[:]
+ return options['c_winlibs'].value[:]
def unix_link_flags_to_native(self, args):
result = []
@@ -1955,11 +1951,7 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
return args
def get_option_link_args(self, options):
- # FIXME: See GnuCCompiler.get_option_link_args
- if 'cpp_winlibs' in options:
- return options['cpp_winlibs'].value[:]
- else:
- return msvc_winlibs[:]
+ return options['cpp_winlibs'].value[:]
GCC_STANDARD = 0
GCC_OSX = 1
@@ -2071,17 +2063,7 @@ class GnuCCompiler(GnuCompiler, CCompiler):
def get_option_link_args(self, options):
if self.gcc_type == GCC_MINGW:
- # FIXME: This check is needed because we currently pass
- # cross-compiler options to the native compiler too and when
- # cross-compiling from Windows to Linux, `options` will contain
- # Linux-specific options which doesn't include `c_winlibs`. The
- # proper fix is to allow cross-info files to specify compiler
- # options and to maintain both cross and native compiler options in
- # coredata: https://github.com/mesonbuild/meson/issues/1029
- if 'c_winlibs' in options:
- return options['c_winlibs'].value[:]
- else:
- return gnu_winlibs[:]
+ return options['c_winlibs'].value[:]
return []
class GnuCPPCompiler(GnuCompiler, CPPCompiler):
@@ -2119,11 +2101,7 @@ class GnuCPPCompiler(GnuCompiler, CPPCompiler):
def get_option_link_args(self, options):
if self.gcc_type == GCC_MINGW:
- # FIXME: See GnuCCompiler.get_option_link_args
- if 'cpp_winlibs' in options:
- return options['cpp_winlibs'].value[:]
- else:
- return gnu_winlibs[:]
+ return options['cpp_winlibs'].value[:]
return []
def get_compiler_check_args(self):
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 3b9f975..ef99511 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1762,12 +1762,12 @@ class Interpreter():
raise InvalidCode('Tried to use unknown language "%s".' % lang)
comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
self.coredata.compilers[lang] = comp
+ # Native compiler always exist so always add its options.
+ new_options = comp.get_options()
if cross_comp is not None:
cross_comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
self.coredata.cross_compilers[lang] = cross_comp
- new_options = cross_comp.get_options()
- else:
- new_options = comp.get_options()
+ new_options.update(cross_comp.get_options())
optprefix = lang + '_'
for i in new_options:
if not i.startswith(optprefix):