diff options
author | John Ericson <git@JohnEricson.me> | 2018-12-12 00:19:03 -0500 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2019-02-02 13:59:14 -0500 |
commit | 19f81d3e33c70c9c902dabaad732e5d33bf05bd4 (patch) | |
tree | f86664395d7233bbba9e3c129c81c7056c6fa98b /run_unittests.py | |
parent | 6dbe33d949237411b1291c30f5383885befb3554 (diff) | |
download | meson-19f81d3e33c70c9c902dabaad732e5d33bf05bd4.zip meson-19f81d3e33c70c9c902dabaad732e5d33bf05bd4.tar.gz meson-19f81d3e33c70c9c902dabaad732e5d33bf05bd4.tar.bz2 |
Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.
Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so
- The logic is cross-agnostic, i.e. there are no conditions affected by
`is_cross_build()`.
- Compiler args for both the build and host machines can always be
controlled by the command line.
- Compiler args for both machines can always be controlled separately.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/run_unittests.py b/run_unittests.py index bc827bc..fb6cacf 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -798,7 +798,7 @@ class InternalTests(unittest.TestCase): env = get_fake_env() compiler = env.detect_c_compiler(False) env.coredata.compilers = {'c': compiler} - env.coredata.compiler_options['c_link_args'] = FakeCompilerOptions() + env.coredata.compiler_options.host['c_link_args'] = FakeCompilerOptions() p1 = Path(tmpdir) / '1' p2 = Path(tmpdir) / '2' p1.mkdir() @@ -2937,10 +2937,10 @@ recommended as it is not supported on some platforms''') # c_args value should be parsed with shlex self.init(testdir, extra_args=['-Dc_args=foo bar "one two"']) obj = mesonbuild.coredata.load(self.builddir) - self.assertEqual(obj.compiler_options['c_args'].value, ['foo', 'bar', 'one two']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['foo', 'bar', 'one two']) self.setconf('-Dc_args="foo bar" one two') obj = mesonbuild.coredata.load(self.builddir) - self.assertEqual(obj.compiler_options['c_args'].value, ['foo bar', 'one', 'two']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['foo bar', 'one', 'two']) self.wipe() # Setting a 2nd time the same option should override the first value @@ -2953,7 +2953,7 @@ recommended as it is not supported on some platforms''') self.assertEqual(obj.builtins['bindir'].value, 'bar') self.assertEqual(obj.builtins['buildtype'].value, 'release') self.assertEqual(obj.base_options['b_sanitize'].value, 'thread') - self.assertEqual(obj.compiler_options['c_args'].value, ['bar']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['bar']) self.setconf(['--bindir=bar', '--bindir=foo', '-Dbuildtype=release', '-Dbuildtype=plain', '-Db_sanitize=thread', '-Db_sanitize=address', @@ -2962,7 +2962,7 @@ recommended as it is not supported on some platforms''') self.assertEqual(obj.builtins['bindir'].value, 'foo') self.assertEqual(obj.builtins['buildtype'].value, 'plain') self.assertEqual(obj.base_options['b_sanitize'].value, 'address') - self.assertEqual(obj.compiler_options['c_args'].value, ['foo']) + self.assertEqual(obj.compiler_options.host['c_args'].value, ['foo']) self.wipe() except KeyError: # Ignore KeyError, it happens on CI for compilers that does not |