aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-10-01 01:11:02 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-10-01 01:11:02 +0300
commitcb64a3f07a91c01c84f80d5303aaf5f0fe5ee100 (patch)
tree44a34ec3a7813414695abc7c9198117c0d3cdcf1
parentb3362e350ad0c8603966bc485e66af553750c648 (diff)
downloadmeson-cb64a3f07a91c01c84f80d5303aaf5f0fe5ee100.zip
meson-cb64a3f07a91c01c84f80d5303aaf5f0fe5ee100.tar.gz
meson-cb64a3f07a91c01c84f80d5303aaf5f0fe5ee100.tar.bz2
Fix MSVC builds.
-rw-r--r--mesonbuild/backend/backends.py4
-rwxr-xr-xrun_unittests.py8
2 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 562e467..c737d49 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -306,7 +306,7 @@ class Backend:
if len(la) == 1 and la[0].startswith(self.environment.get_source_dir()):
# The only link argument is an absolute path to a library file.
libpath = la[0]
- if not(libpath.lower().endswith('.dll') or libpath.lower().endswith('.so')):
+ if os.path.splitext(libpath)[1] not in ['.dll', '.lib', '.so']:
continue
absdir = os.path.split(libpath)[0]
rel_to_src = absdir[len(self.environment.get_source_dir())+1:]
@@ -530,6 +530,8 @@ class Backend:
dirseg = os.path.join(self.environment.get_build_dir(), self.get_target_dir(ld))
if dirseg not in result:
result.append(dirseg)
+ for deppath in self.rpaths_for_bundled_shared_libraries(target):
+ result.append(os.path.normpath(os.path.join(self.environment.get_build_dir(), deppath)))
return result
def write_benchmark_file(self, datafile):
diff --git a/run_unittests.py b/run_unittests.py
index abff78a..b1021e0 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -1368,7 +1368,7 @@ int main(int argc, char **argv) {
if compiler == 'cl':
extra_args = []
shlibfile = os.path.join(tdir, 'alexandria.' + shared_suffix)
- link_cmd = ['link', '/NOLOGO','/DLL', '/DEBUG', '/IMPLIB:alexandria.lib' '/OUT:' + shlibfile, objectfile]
+ link_cmd = ['link', '/NOLOGO','/DLL', '/DEBUG', '/IMPLIB:' + os.path.join(tdir, 'alexandria.lib'), '/OUT:' + shlibfile, objectfile]
else:
extra_args = ['-fPIC']
shlibfile = os.path.join(tdir, 'libalexandria.' + shared_suffix)
@@ -1384,6 +1384,12 @@ int main(int argc, char **argv) {
self.run_tests()
finally:
os.unlink(shlibfile)
+ if mesonbuild.mesonlib.is_windows():
+ # Clean up all the garbage MSVC writes in the
+ # source tree.
+ for fname in glob(os.path.join(tdir, 'alexandria.*')):
+ if os.path.splitext(fname)[1] not in ['.c', '.h']:
+ os.unlink(fname)
class FailureTests(BasePlatformTests):
'''