summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/build.py2
-rw-r--r--test cases/rust/20 rust and cpp/meson.build2
-rw-r--r--unittests/allplatformstests.py5
3 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 2adfb9803..d4890623c 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -900,7 +900,7 @@ class BuildTarget(Target):
# No source files or parent targets, target consists of only object
# files of unknown origin. Just add the first clink compiler
# that we have and hope that it can link these objects
- for lang in link_langs:
+ for lang in reversed(link_langs):
if lang in self.all_compilers:
self.compilers[lang] = self.all_compilers[lang]
break
diff --git a/test cases/rust/20 rust and cpp/meson.build b/test cases/rust/20 rust and cpp/meson.build
index c3010123a..2a545f9bf 100644
--- a/test cases/rust/20 rust and cpp/meson.build
+++ b/test cases/rust/20 rust and cpp/meson.build
@@ -8,7 +8,7 @@ project(
meson_version : '>= 1.2.0',
)
-cpplib = static_library('cpp', 'lib.cpp')
+cpplib = static_library('cpp-lib', 'lib.cpp')
exe = executable('main', 'main.rs', link_with : cpplib)
test('main', exe)
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 535e479a6..f158be777 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -3343,6 +3343,11 @@ class AllPlatformTests(BasePlatformTests):
testdir = os.path.join(self.unit_test_dir, '58 introspect buildoptions')
self._run(self.mconf_command + [testdir])
+ @skip_if_not_language('rust')
+ def test_meson_configure_srcdir(self):
+ testdir = os.path.join(self.rust_test_dir, '20 rust and cpp')
+ self._run(self.mconf_command + [testdir])
+
def test_introspect_buildoptions_cross_only(self):
testdir = os.path.join(self.unit_test_dir, '82 cross only introspect')
testfile = os.path.join(testdir, 'meson.build')