aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-04-14 13:58:21 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2017-07-20 21:11:56 +0100
commit3fa3922cea27026d44aef1cdf3ca92d82adc7ced (patch)
tree512b4bed85b53dfd95add859b0724a1ed84d9754 /run_project_tests.py
parentb43f4841ba5de2e8bc956eb9fd1f578f90d7ae15 (diff)
downloadmeson-3fa3922cea27026d44aef1cdf3ca92d82adc7ced.zip
meson-3fa3922cea27026d44aef1cdf3ca92d82adc7ced.tar.gz
meson-3fa3922cea27026d44aef1cdf3ca92d82adc7ced.tar.bz2
Support implibs for executables on Windows
Add a boolean 'implib' kwarg to executable(). If true, it is permitted to use the returned build target object in link_with: On platforms where this makes sense (e.g. Windows), an implib is generated for the executable and used when linking. Otherwise, it has no effect. (Rather than checking if it is a StaticLibrary or SharedLibary, BuildTarget subclasses gain the is_linkable_target method to test if they can appear in link_with:) Also install any executable implib in a similar way to a shared library implib, i.e. placing the implib in the appropriate place Add tests of: - a shared_module containing a reference to a symbol which is known (at link time) to be provided by the executable - trying to link with non-implib executables (should fail) - installing the implib (This last one needs a little enhancement of the installed file checking as this is the first install test we have which needs to work with either MSVC-style or GCC-style implib filenames)
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 3420946..69a778e 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -183,7 +183,7 @@ def get_relative_files_list_from_dir(fromdir):
paths.append(path)
return paths
-def platform_fix_name(fname):
+def platform_fix_name(fname, compiler):
if '?lib' in fname:
if mesonlib.is_cygwin():
fname = re.sub(r'\?lib(.*)\.dll$', r'cyg\1.dll', fname)
@@ -195,6 +195,16 @@ def platform_fix_name(fname):
if mesonlib.is_windows() or mesonlib.is_cygwin():
return fname + '.exe'
+ if fname.startswith('?msvc:'):
+ fname = fname[6:]
+ if compiler != 'cl':
+ return None
+
+ if fname.startswith('?gcc:'):
+ fname = fname[5:]
+ if compiler == 'cl':
+ return None
+
return fname
def validate_install(srcdir, installdir, compiler):
@@ -210,7 +220,9 @@ def validate_install(srcdir, installdir, compiler):
elif os.path.exists(info_file):
with open(info_file) as f:
for line in f:
- expected[platform_fix_name(line.strip())] = False
+ line = platform_fix_name(line.strip(), compiler)
+ if line:
+ expected[line] = False
# Check if expected files were found
for fname in expected:
file_path = os.path.join(installdir, fname)