aboutsummaryrefslogtreecommitdiff
path: root/unittests/baseplatformtests.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-01-28 14:59:33 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2022-01-30 02:13:42 +0530
commit2512c25c0bb3649c4cc8be20ac30d59630241ae4 (patch)
treee3d7ec5c29f28a3fd2860951c15d692e0294c14d /unittests/baseplatformtests.py
parent029652ecb5da390ff3acc71ab98c9d53b2aa1a12 (diff)
downloadmeson-2512c25c0bb3649c4cc8be20ac30d59630241ae4.zip
meson-2512c25c0bb3649c4cc8be20ac30d59630241ae4.tar.gz
meson-2512c25c0bb3649c4cc8be20ac30d59630241ae4.tar.bz2
ninja backend: Fix usage of same constants file for native and cross
For example: ``` meson builddir \ --native-file vs2019-paths.txt \ --native-file vs2019-win-x64.txt \ --cross-file vs2019-paths.txt \ --cross-file vs2019-win-arm64.txt ``` This was causing the error: > ERROR: Multiple producers for Ninja target "/path/to/vs2019-paths.txt". Please rename your targets. Fix it by using a set() when generating the list of regen files, and add a test for it too.
Diffstat (limited to 'unittests/baseplatformtests.py')
-rw-r--r--unittests/baseplatformtests.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py
index cfc78ce..c1175b4 100644
--- a/unittests/baseplatformtests.py
+++ b/unittests/baseplatformtests.py
@@ -56,8 +56,8 @@ class BasePlatformTests(TestCase):
# Get the backend
self.backend = getattr(Backend, os.environ['MESON_UNIT_TEST_BACKEND'])
self.meson_args = ['--backend=' + self.backend.name]
- self.meson_native_file = None
- self.meson_cross_file = None
+ self.meson_native_files = []
+ self.meson_cross_files = []
self.meson_command = python_command + [get_meson_script()]
self.setup_command = self.meson_command + self.meson_args
self.mconf_command = self.meson_command + ['configure']
@@ -192,10 +192,10 @@ class BasePlatformTests(TestCase):
args += ['--prefix', self.prefix]
if self.libdir:
args += ['--libdir', self.libdir]
- if self.meson_native_file:
- args += ['--native-file', self.meson_native_file]
- if self.meson_cross_file:
- args += ['--cross-file', self.meson_cross_file]
+ for f in self.meson_native_files:
+ args += ['--native-file', f]
+ for f in self.meson_cross_files:
+ args += ['--cross-file', f]
self.privatedir = os.path.join(self.builddir, 'meson-private')
if inprocess:
try: