OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
7 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
8 import("//build/config/nacl/config.gni") | 8 import("//build/config/nacl/config.gni") |
9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 if (linux_use_bundled_binutils) { | 365 if (linux_use_bundled_binutils) { |
366 cflags += [ "-B$binutils_path" ] | 366 cflags += [ "-B$binutils_path" ] |
367 } | 367 } |
368 | 368 |
369 # Clang-specific compiler flags setup. | 369 # Clang-specific compiler flags setup. |
370 # ------------------------------------ | 370 # ------------------------------------ |
371 if (is_clang) { | 371 if (is_clang) { |
372 cflags += [ "-fcolor-diagnostics" ] | 372 cflags += [ "-fcolor-diagnostics" ] |
373 } | 373 } |
374 | 374 |
| 375 # Print absolute paths in diagnostics. There is no precedent for doing this |
| 376 # on Linux/Mac (GCC doesn't support it), but MSVC does this with /FC and |
| 377 # Windows developers rely on it (crbug.com/636109) so only do this on Windows. |
| 378 # TODO(hans) Remove llvm_force_head_revision check in next clang roll. |
| 379 if (is_clang && is_win && llvm_force_head_revision) { |
| 380 cflags += [ "-fdiagnostics-absolute-paths" ] |
| 381 } |
| 382 |
375 # Makes builds independent of absolute file path. | 383 # Makes builds independent of absolute file path. |
376 # clang-cl (used if is_win) doesn't expose this flag. | 384 # clang-cl (used if is_win) doesn't expose this flag. |
377 # Currently disabled for nacl since its toolchain lacks this flag (too old). | 385 # Currently disabled for nacl since its toolchain lacks this flag (too old). |
378 # TODO(zforman): Once nacl's toolchain is updated, remove check. | 386 # TODO(zforman): Once nacl's toolchain is updated, remove check. |
379 if (is_clang && is_linux) { | 387 if (is_clang && is_linux) { |
380 absolute_path = rebase_path("//.") | 388 absolute_path = rebase_path("//.") |
381 cflags += [ "-fdebug-prefix-map=$absolute_path=." ] | 389 cflags += [ "-fdebug-prefix-map=$absolute_path=." ] |
382 } | 390 } |
383 | 391 |
384 # C++11 compiler flags setup. | 392 # C++11 compiler flags setup. |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 | 1592 |
1585 if (is_ios || is_mac) { | 1593 if (is_ios || is_mac) { |
1586 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1594 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1587 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1595 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1588 config("enable_arc") { | 1596 config("enable_arc") { |
1589 common_flags = [ "-fobjc-arc" ] | 1597 common_flags = [ "-fobjc-arc" ] |
1590 cflags_objc = common_flags | 1598 cflags_objc = common_flags |
1591 cflags_objcc = common_flags | 1599 cflags_objcc = common_flags |
1592 } | 1600 } |
1593 } | 1601 } |
OLD | NEW |