Commit 7b9ef859 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

win: Try to make midl.py work with midl.exe 8.1.620

Bug: 756607
Change-Id: I78e1fdf2411c067efd5423987ab9812f14b93736
Reviewed-on: https://chromium-review.googlesource.com/680041Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504255}
parent 5a463b0b
......@@ -427,13 +427,3 @@ config("target_winrt") {
"/EHsc",
]
}
# Internal stuff --------------------------------------------------------------
# Config used by the MIDL template to disable warnings.
config("midl_warnings") {
if (is_clang) {
# MIDL generates code like "#endif !_MIDL_USE_GUIDDEF_".
cflags = [ "-Wno-extra-tokens" ]
}
}
......@@ -92,7 +92,5 @@ template("midl") {
public_deps = [
":$action_name",
]
configs += [ "//build/config/win:midl_warnings" ]
}
}
......@@ -36,6 +36,16 @@ def ZapTimestamp(filename):
'target_arch=(AMD64|X86) 8\.\d\d\.\d{4}',
' Oicf, W1, Zp8, env=\\1 (32b run), target_arch=\\2 8.xx.xxxx',
contents)
# TODO(thakis): If we need more hacks than these, try to verify checked-in
# outputs when we're using the hermetic toolchain.
# midl.exe older than 8.1.622 omit '//' after #endif, fix that:
contents = contents.replace('#endif !_MIDL_USE_GUIDDEF_',
'#endif // !_MIDL_USE_GUIDDEF_')
# midl.exe puts the midl version into code in one place. To have
# predictable output, lie about the midl version if it's not 8.1.622.
# This is unfortunate, but remember that there's beauty too in imperfection.
contents = contents.replace('0x801026c, /* MIDL Version 8.1.620 */',
'0x801026e, /* MIDL Version 8.1.622 */')
open(filename, 'wb').write(contents)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment