aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorMartin Hostettler <textshell@uchuujin.de>2018-02-18 17:55:19 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2018-04-14 23:43:29 +0300
commit3f7c6cf3d6a204e9665faad3c05bb5049f08ac74 (patch)
tree70ac29c3483fe52c470033e6f593a7d9f2b29b07 /run_unittests.py
parent7c37ca15f38dce30eeef6cd8bc53f25406f9029e (diff)
downloadmeson-3f7c6cf3d6a204e9665faad3c05bb5049f08ac74.zip
meson-3f7c6cf3d6a204e9665faad3c05bb5049f08ac74.tar.gz
meson-3f7c6cf3d6a204e9665faad3c05bb5049f08ac74.tar.bz2
Improve generation of pkg-config files for static only libraries.
Previously pkg-config files generated by the pkgconfig modules for static libraries with dependencies could only be used in a dependencies with `static: true`. This was caused by the dependencies only appearing in Libs.private even if they are needed in the default linking mode. But a user of a dependency should not have to know if the default linking mode is static or dynamic; A dependency('somelib') call should always pull in all needed pieces into the build. Now for meson build static libraries passed via `libraries` to the generate method automatically promote dependencies to public.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py
index 1e8a778..0f9a50b 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2841,6 +2841,27 @@ endian = 'little'
self.assertTrue(os.path.isfile(test_exe))
subprocess.check_call(test_exe, env=myenv)
+ @unittest.skipIf(shutil.which('pkg-config') is None, 'Pkg-config not found.')
+ def test_pkgconfig_internal_libraries(self):
+ '''
+ '''
+ with tempfile.TemporaryDirectory() as tempdirname:
+ # build library
+ testdirbase = os.path.join(self.unit_test_dir, '28 pkgconfig use libraries')
+ testdirlib = os.path.join(testdirbase, 'lib')
+ self.init(testdirlib, extra_args=['--prefix=' + tempdirname,
+ '--libdir=lib',
+ '--default-library=static'], default_args=False)
+ self.build()
+ self.install(use_destdir=False)
+
+ # build user of library
+ pkg_dir = os.path.join(tempdirname, 'lib/pkgconfig')
+ os.environ['PKG_CONFIG_PATH'] = pkg_dir
+ self.new_builddir()
+ self.init(os.path.join(testdirbase, 'app'))
+ self.build()
+
class LinuxArmCrossCompileTests(BasePlatformTests):
'''