aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-09-21 14:48:07 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2018-11-04 15:42:06 +0000
commite57fd018308e0ea5185391b3b6a76bb47479b7d7 (patch)
tree39bb609a6cb99117c39167987e37c9f20cfcd009 /mesonbuild
parent64edfd50691be21fae1e61b8864d6de6fcead1d4 (diff)
downloadmeson-e57fd018308e0ea5185391b3b6a76bb47479b7d7.zip
meson-e57fd018308e0ea5185391b3b6a76bb47479b7d7.tar.gz
meson-e57fd018308e0ea5185391b3b6a76bb47479b7d7.tar.bz2
Accomodate clang-cl /showIncludes output
Accomodate clang-cl /showIncludes output in detect_vs_dep_prefix(). clang-cl outputs lines terminated with \n, not \r\n v2: should invoke the detected compiler, not hardcode 'cl'
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/ninjabackend.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index b6ed515..28c6480 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -185,7 +185,8 @@ int dummy;
# and locale dependent. Any attempt at converting it to
# Python strings leads to failure. We _must_ do this detection
# in raw byte mode and write the result in raw bytes.
- pc = subprocess.Popen(['cl', '/showIncludes', '/c', 'incdetect.c'],
+ pc = subprocess.Popen([compiler.get_exelist(),
+ '/showIncludes', '/c', 'incdetect.c'],
cwd=self.environment.get_scratch_dir(),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdo, _) = pc.communicate()
@@ -195,7 +196,7 @@ int dummy;
# different locales have different messages with a different
# number of colons. Match up to the the drive name 'd:\'.
matchre = re.compile(rb"^(.*\s)[a-zA-Z]:\\.*stdio.h$")
- for line in stdo.split(b'\r\n'):
+ for line in re.split(rb'\r?\n', stdo):
match = matchre.match(line)
if match:
with open(tempfilename, 'ab') as binfile: