summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-07-17 22:54:58 +0300
committerJohn Ericson <git@JohnEricson.me>2019-08-08 09:43:12 -0400
commit74ee75903c0a5f2ae824243f74efbfce7f624b4c (patch)
treec21df329c1194c882caa2e8ea41b50fa8eb90cf6
parent388e676c34c9ec811cb098f1d3de292850573bc3 (diff)
downloadmeson-mirrorbuild.options.tar.gz
Make c_std / cpp_std affect all platformsmirrorbuild.options
-rwxr-xr-xrun_unittests.py4
-rw-r--r--test cases/unit/51 std remains/meson.build8
2 files changed, 12 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 0ca7067bc..5727def62 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3717,6 +3717,8 @@ recommended as it is not supported on some platforms''')
for idx, i in enumerate(res1):
if i['name'] == 'cpp_std':
res1[idx]['value'] = 'c++14'
+ if i['name'] == 'build.cpp_std':
+ res1[idx]['value'] = 'c++14'
if i['name'] == 'buildtype':
res1[idx]['value'] = 'release'
if i['name'] == 'optimization':
@@ -5389,7 +5391,9 @@ endian = 'little'
testdir = os.path.join(self.unit_test_dir, '51 std remains')
self.init(testdir)
compdb = self.get_compdb()
+ self.assertEqual(len(compdb), 2)
self.assertRegex(compdb[0]['command'], '-std=c99')
+ self.assertRegex(compdb[1]['command'], '-std=c99')
self.build()
def test_identity_cross(self):
diff --git a/test cases/unit/51 std remains/meson.build b/test cases/unit/51 std remains/meson.build
index ac6f9e247..e192d7c68 100644
--- a/test cases/unit/51 std remains/meson.build
+++ b/test cases/unit/51 std remains/meson.build
@@ -1,2 +1,10 @@
project('std_remains', 'c', default_options: ['c_std=c99'])
+
executable('prog', 'prog.c')
+
+# Check that native: true does not affect the use of c_std in
+# non-cross builds
+
+if not meson.is_cross_build()
+ executable('prog2', 'prog.c', native: true)
+endif