aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-11-10 23:40:24 +0200
committerGitHub <noreply@github.com>2018-11-10 23:40:24 +0200
commit59774702b2a09eed289a9b9df89b9b716d27f6c1 (patch)
treeb7b57d80cac0704c465a5c4cc7f706772353a861 /run_project_tests.py
parent142f8a1da66c3a3342611632899aad97e57bfd7e (diff)
parent94cdb68a3a1336e3806dc98ea4da0595ccd14a1b (diff)
downloadmeson-59774702b2a09eed289a9b9df89b9b716d27f6c1.zip
meson-59774702b2a09eed289a9b9df89b9b716d27f6c1.tar.gz
meson-59774702b2a09eed289a9b9df89b9b716d27f6c1.tar.bz2
Merge pull request #4480 from jon-turney/fix-implib-prefix-suffix
Fix naming of implib when name_prefix/suffix is used
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py57
1 files changed, 49 insertions, 8 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index c73567e..0d64f47 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -118,10 +118,25 @@ def get_relative_files_list_from_dir(fromdir):
return paths
def platform_fix_name(fname, compiler, env):
+ # canonicalize compiler
+ if compiler == 'clang-cl':
+ canonical_compiler = 'msvc'
+ else:
+ canonical_compiler = compiler
+
if '?lib' in fname:
- if mesonlib.for_cygwin(env.is_cross_build(), env):
+ if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc':
+ fname = re.sub(r'lib/\?lib(.*)\.', r'bin/\1.', fname)
+ fname = re.sub(r'/\?lib/', r'/bin/', 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)
+ fname = re.sub(r'/\?lib/', r'/bin/', 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)
+ fname = re.sub(r'/\?lib/', r'/bin/', fname)
else:
fname = re.sub(r'\?lib', 'lib', fname)
@@ -132,17 +147,47 @@ def platform_fix_name(fname, compiler, env):
if fname.startswith('?msvc:'):
fname = fname[6:]
- if compiler != 'msvc':
+ if canonical_compiler != 'msvc':
return None
if fname.startswith('?gcc:'):
fname = fname[5:]
- if compiler == 'msvc':
+ if canonical_compiler == 'msvc':
return None
if fname.startswith('?cygwin:'):
fname = fname[8:]
- if compiler == 'msvc' or not mesonlib.for_cygwin(env.is_cross_build(), env):
+ if 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') or fname.endswith('?implibempty'):
+ if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc':
+ # only MSVC doesn't generate empty implibs
+ if fname.endswith('?implibempty') and compiler == 'msvc':
+ return None
+ return re.sub(r'/(?:lib|)([^/]*?)\?implib(?:empty|)$', r'/\1.lib', fname)
+ elif mesonlib.for_windows(env.is_cross_build(), env) or mesonlib.for_cygwin(env.is_cross_build(), env):
+ return re.sub(r'\?implib(?:empty|)$', r'.dll.a', fname)
+ else:
return None
return fname
@@ -696,10 +741,6 @@ def detect_system_compiler():
raise RuntimeError("Could not find C compiler.")
system_compiler = comp.get_id()
- # canonicalize for platform_fix_name()
- if system_compiler == 'clang-cl':
- system_compiler = 'msvc'
-
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Run the test suite of Meson.")
parser.add_argument('extra_args', nargs='*',