diff options
author | Bert Belder <bertbelder@gmail.com> | 2018-09-10 04:27:58 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2018-09-10 04:29:18 +0200 |
commit | 3574c7a5d39c6cd55e7c25a10e4e5c8e363b7af9 (patch) | |
tree | c91df34e8c745f574cbc20afde3d04fbc39b604e | |
parent | 8ace0f142f3b4b7300a6ca5deafc9cb8da7230cf (diff) |
tools/setup: on windows, make env vars not affect gn gen output
-rw-r--r-- | tools/third_party.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/third_party.py b/tools/third_party.py index e831d57af..c669a81e3 100644 --- a/tools/third_party.py +++ b/tools/third_party.py @@ -33,9 +33,23 @@ def google_env(env=None, merge_env={}, depot_tools_path=depot_tools_path): path_prefix = depot_tools_path + os.path.pathsep if not env['PATH'].startswith(path_prefix): env['PATH'] = path_prefix + env['PATH'] - # We're not using Google's internal infrastructure. - if os.name == 'nt' and not 'DEPOT_TOOLS_WIN_TOOLCHAIN' in env: - env['DEPOT_TOOLS_WIN_TOOLCHAIN'] = "0" + + if os.name == "nt": # Windows-only enviroment tweaks. + # We're not using Google's internal infrastructure. + if os.name == "nt" and not "DEPOT_TOOLS_WIN_TOOLCHAIN" in env: + env["DEPOT_TOOLS_WIN_TOOLCHAIN"] = "0" + + # The 'setup_toolchain.py' script does a good job finding the Windows + # SDK. Unfortunately, if any of the environment variables below are set + # (as vcvarsall.bat typically would), setup_toolchain absorbs them too, + # adding multiple identical -imsvc<path> items to CFLAGS. + # This small variation has no effect on compiler output, but it + # makes ninja rebuild everything, and causes sccache cache misses. + # TODO(piscisaureus): fix this upstream. + env["INCLUDE"] = "" + env["LIB"] = "" + env["LIBPATH"] = "" + return env |