Commit c0791537 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

win/clang: Pass /X to the compiler.

This tells the compiler to not look in various env vars (e.g. %INCLUDE%)
which makes the build slightly more hermetic.

(MSVC still uses the env files to get at %INCLUDE% so we can't pass /X to cl,
but clang-cl gets all system include dirs passed as -imsvc flags instead.)

Also move /utf-8 from the warnings config to the compiler config as it's
not a warning flag.

Bug: 691286
Change-Id: I5306d33bbfacd03a267b9d1c082297a26aadf9b8
Reviewed-on: https://chromium-review.googlesource.com/993552Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548030}
parent e176f8b9
...@@ -247,6 +247,15 @@ config("compiler") { ...@@ -247,6 +247,15 @@ config("compiler") {
cflags += [ "-fstack-protector" ] cflags += [ "-fstack-protector" ]
} }
} }
} else {
cflags += [
# Assume UTF-8 by default to avoid code page dependencies.
"/utf-8",
]
if (is_clang) {
# Don't look for includes in %INCLUDE%.
cflags += [ "/X" ]
}
} }
# Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for
...@@ -1119,11 +1128,6 @@ config("default_warnings") { ...@@ -1119,11 +1128,6 @@ config("default_warnings") {
ldflags += [ "/WX" ] ldflags += [ "/WX" ]
} }
cflags += [
# Assume UTF-8 by default to avoid code page dependencies.
"/utf-8",
]
cflags += [ cflags += [
# Warnings permanently disabled: # Warnings permanently disabled:
......
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