Commit 884a46c1 authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

Allow to specify -fdebug-compilation-dir for clang-cl

Now if we specify -fdebug-compilation-dir, clang-cl emits obj files independent from build directory.
So this flag will allow to sharing build cache when engineers use goma on different build directory.

To debug executable with this flag, we need to specify 'debug source files' property in visual studio.
Some goma backend preparation for build cache sharing is on-going yet, but I will ask windows developer to try the flag to confirm it does not break their workflow.

This is windows version of below proposal.
https://docs.google.com/document/d/1OX4jY_bOCeNK7PNjVRuBQE9s6BQKS8XRNWGK8FEyh-E/edit?usp=sharing

Bug: 712796
Change-Id: I65e6da67614839e5dde408038cad33a63dc28ac1
Reviewed-on: https://chromium-review.googlesource.com/1118200
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571431}
parent 46b73d21
...@@ -511,13 +511,13 @@ config("compiler") { ...@@ -511,13 +511,13 @@ config("compiler") {
# clang-cl (used if is_win) doesn't expose this flag. # clang-cl (used if is_win) doesn't expose this flag.
# Currently disabled for nacl since its toolchain lacks this flag (too old). # Currently disabled for nacl since its toolchain lacks this flag (too old).
# TODO(zforman): Once nacl's toolchain is updated, remove check. # TODO(zforman): Once nacl's toolchain is updated, remove check.
if (symbol_level != 0 && is_clang && !is_nacl && !is_win && !is_mac && if (symbol_level != 0 && is_clang && !is_nacl && !is_mac && !is_ios &&
!is_ios && strip_absolute_paths_from_debug_symbols) { strip_absolute_paths_from_debug_symbols) {
# If debug option is given, clang includes $cwd in debug info. # If debug option is given, clang includes $cwd in debug info by default.
# In such build, this flag generates reproducible obj files # For such build, this flag generates reproducible obj files even we use
# even we use build directory like "out/feature_a" and "out/feature_b" if # different build directory like "out/feature_a" and "out/feature_b" if
# we build same files with same compile flag other than this. # we build same files with same compile flag.
# Other paths are already givne in relative, no need to normalize them. # Other paths are already given in relative, no need to normalize them.
cflags += [ cflags += [
"-Xclang", "-Xclang",
"-fdebug-compilation-dir", "-fdebug-compilation-dir",
......
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