aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2018-12-09 09:30:54 +0100
committerXavier Claessens <xclaesse@gmail.com>2018-12-12 10:42:32 -0500
commit261ab9b2140005d4f7e42118ccb6598fa5b7f15d (patch)
tree67f3113b526ed2eb271e6de7d9e3f74f647b254a /run_unittests.py
parentf0ee06bdab658eb021b911ccffaad2ad31d3e900 (diff)
downloadmeson-261ab9b2140005d4f7e42118ccb6598fa5b7f15d.zip
meson-261ab9b2140005d4f7e42118ccb6598fa5b7f15d.tar.gz
meson-261ab9b2140005d4f7e42118ccb6598fa5b7f15d.tar.bz2
pkgconfig: Fix link order of library dependencies
Since `_process_libs` appends the lib's dependencies this list already, the final return value of `_process_libs` will end up after its dependencies, which is the wrong way around. (The lib must come first, then its dependencies) The easiest solution is to simply pre-pend the return value of `_process_libs` rather than appending it, so that its dependencies come after the library itself. Closes #4091.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index f1b2249..a47f74e 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -4274,6 +4274,19 @@ endian = 'little'
self.assertEqual("-r/usr/lib/libsomething.dll", str(stdo.decode('ascii')).strip())
+ @skipIfNoPkgconfig
+ def test_pkgconfig_link_order(self):
+ '''
+ Test that libraries are listed before their dependencies.
+ '''
+ testdir = os.path.join(self.unit_test_dir, '50 pkgconfig static link order')
+ self.init(testdir)
+ myenv = os.environ.copy()
+ myenv['PKG_CONFIG_PATH'] = self.privatedir
+ stdo = subprocess.check_output(['pkg-config', '--libs', 'libsomething'], env=myenv)
+ deps = stdo.split()
+ self.assertTrue(deps.index(b'-lsomething') < deps.index(b'-ldependency'))
+
def test_deterministic_dep_order(self):
'''
Test that the dependencies are always listed in a deterministic order.