Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 60954b3dcc064e606e2db5f8ed1ac909c60b413f..dde34c1eac64bd041b2d48ea0097d50efbde2b5e 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -307,6 +307,15 @@ config("compiler") { |
cflags += [ "-fcolor-diagnostics" ] |
} |
+ # Makes builds independent of absolute file path. |
+ # clang-cl (used if is_win) doesn't expose this flag. |
+ # Currently disabled for nacl since its toolchain lacks this flag (too old). |
+ # TODO(zforman): Once nacl's toolchain is updated, remove check. |
+ if (is_clang && !is_win && !is_nacl) { |
+ absolute_path = rebase_path("//.") |
+ cflags += [ "-fdebug-prefix-map=$absolute_path=." ] |
+ } |
+ |
# C++11 compiler flags setup. |
# --------------------------- |
if (is_linux || is_android || (is_nacl && is_clang)) { |