aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-10-31 12:31:10 +0000
committerJon Turney <jon.turney@dronecode.org.uk>2018-11-06 13:17:12 +0000
commitb17f6dae541ec9744e82c2cb6f1c31c9a76b45f5 (patch)
treee5b59a95a1e9a83965d66a8d284cebda01b594c1 /run_project_tests.py
parent7a959ffbba6a410a25ec4fef6a6ff039d8c604e2 (diff)
downloadmeson-b17f6dae541ec9744e82c2cb6f1c31c9a76b45f5.zip
meson-b17f6dae541ec9744e82c2cb6f1c31c9a76b45f5.tar.gz
meson-b17f6dae541ec9744e82c2cb6f1c31c9a76b45f5.tar.bz2
Add a test of installed library names when name_{suf,pre}fix: is used
Extend platform_fix_name() to handle this case We avoid using library(version:), so we don't have to teach platform_fix_name() all the platform details of versioned shared library naming. Hopefully that's exercised by platform-specific tests...
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py35
1 files changed, 34 insertions, 1 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index c73567e..6f7d9d7 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -119,8 +119,14 @@ def get_relative_files_list_from_dir(fromdir):
def platform_fix_name(fname, compiler, env):
if '?lib' in fname:
- if mesonlib.for_cygwin(env.is_cross_build(), env):
+ if mesonlib.for_windows(env.is_cross_build(), env) and compiler == 'msvc':
+ fname = re.sub(r'lib/\?lib(.*)\.', r'bin/\1.', fname)
+ elif mesonlib.for_windows(env.is_cross_build(), env):
+ fname = re.sub(r'lib/\?lib(.*)\.', r'bin/lib\1.', fname)
+ fname = re.sub(r'\?lib(.*)\.dll$', r'lib\1.dll', fname)
+ elif mesonlib.for_cygwin(env.is_cross_build(), env):
fname = re.sub(r'lib/\?lib(.*)\.so$', r'bin/cyg\1.dll', fname)
+ fname = re.sub(r'lib/\?lib(.*)\.', r'bin/cyg\1.', fname)
fname = re.sub(r'\?lib(.*)\.dll$', r'cyg\1.dll', fname)
else:
fname = re.sub(r'\?lib', 'lib', fname)
@@ -145,6 +151,33 @@ def platform_fix_name(fname, compiler, env):
if compiler == 'msvc' or not mesonlib.for_cygwin(env.is_cross_build(), env):
return None
+ if fname.endswith('?so'):
+ if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc':
+ fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname)
+ fname = re.sub(r'/(?:lib|)([^/]*?)\?so$', r'/\1.dll', fname)
+ return fname
+ elif mesonlib.for_windows(env.is_cross_build(), env):
+ fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname)
+ fname = re.sub(r'/([^/]*?)\?so$', r'/\1.dll', fname)
+ return fname
+ elif mesonlib.for_cygwin(env.is_cross_build(), env):
+ fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname)
+ fname = re.sub(r'/lib([^/]*?)\?so$', r'/cyg\1.dll', fname)
+ fname = re.sub(r'/([^/]*?)\?so$', r'/\1.dll', fname)
+ return fname
+ elif mesonlib.for_darwin(env.is_cross_build(), env):
+ return fname[:-3] + '.dylib'
+ else:
+ return fname[:-3] + '.so'
+
+ if fname.endswith('?implib'):
+ if mesonlib.for_windows(env.is_cross_build(), env) and compiler == 'msvc':
+ return re.sub(r'/(?:lib|)([^/]*?)\?implib$', r'/\1.lib', fname)
+ elif mesonlib.for_windows(env.is_cross_build(), env) or mesonlib.for_cygwin(env.is_cross_build(), env):
+ return fname[:-7] + '.dll.a'
+ else:
+ return None
+
return fname
def validate_install(srcdir, installdir, compiler, env):