summaryrefslogtreecommitdiff
path: root/test cases/unit
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-11-29 10:23:57 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-12-03 10:06:11 +0530
commit390f0b8b522a7c73880349a250400a2802927b66 (patch)
tree447ba82ec439b6761d88236d5ce0f1cc77865ba4 /test cases/unit
parent554b484468c74621168f7bb7faf7110e7e72ebd5 (diff)
downloadmeson-390f0b8b522a7c73880349a250400a2802927b66.tar.gz
dependencies: Convert /c/foo/bar paths to C:/foo/bar
MSVC cannot handle MinGW-esque /c/foo paths, convert them to C:/foo. We cannot resolve other paths starting with / like /home/foo so leave them as-is so the user gets an error/warning from the compiler/linker. These paths are commonly found in pkg-config files generated using Autotools inside MinGW/MSYS and MinGW/MSYS2 environments. Currently this is only done for PkgConfigDependency.
Diffstat (limited to 'test cases/unit')
-rw-r--r--test cases/unit/17 pkgconfig static/meson.build16
1 files changed, 15 insertions, 1 deletions
diff --git a/test cases/unit/17 pkgconfig static/meson.build b/test cases/unit/17 pkgconfig static/meson.build
index caeb4aae2..d1b0fd5ac 100644
--- a/test cases/unit/17 pkgconfig static/meson.build
+++ b/test cases/unit/17 pkgconfig static/meson.build
@@ -5,8 +5,22 @@ if build_machine.system() != 'windows'
else
# pkg-config files should not use paths with \
prefix_parts = meson.source_root().split('\\')
- prefix = '/'.join(prefix_parts)
+ # If the path is C:/foo/bar, convert it to /c/foo/bar so we can test if our
+ # automatic conversion to C:/foo/bar inside PkgConfigDependency is working.
+ if prefix_parts[0][1] == ':'
+ drive = prefix_parts[0][0]
+ else
+ drive = prefix_parts[0]
+ endif
+ new_parts = []
+ foreach part : prefix_parts
+ if part != prefix_parts[0]
+ new_parts += part
+ endif
+ endforeach
+ prefix = '/@0@/@1@'.format(drive, '/'.join(new_parts))
endif
+message(prefix)
# Escape spaces
prefix_parts = prefix.split(' ')