Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Side by Side Diff: build/toolchain/gcc_toolchain.gni

Issue 2617283002: Add Clang static analyzer to Clang toolchain defs in GN (Closed)
Patch Set: wez feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/toolchain/clang_static_analyzer_wrapper.py ('k') | build/toolchain/wrapper_utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/clang/clang.gni") 6 import("//build/config/clang/clang.gni")
7 import("//build/config/nacl/config.gni") 7 import("//build/config/nacl/config.gni")
8 import("//build/config/sanitizers/sanitizers.gni") 8 import("//build/config/sanitizers/sanitizers.gni")
9 import("//build/config/v8_target_cpu.gni") 9 import("//build/config/v8_target_cpu.gni")
10 import("//build/toolchain/cc_wrapper.gni") 10 import("//build/toolchain/cc_wrapper.gni")
11 import("//build/toolchain/clang_static_analyzer.gni")
11 import("//build/toolchain/goma.gni") 12 import("//build/toolchain/goma.gni")
12 import("//build/toolchain/toolchain.gni") 13 import("//build/toolchain/toolchain.gni")
13 14
14 # This template defines a toolchain for something that works like gcc 15 # This template defines a toolchain for something that works like gcc
15 # (including clang). 16 # (including clang).
16 # 17 #
17 # It requires the following variables specifying the executables to run: 18 # It requires the following variables specifying the executables to run:
18 # - ar 19 # - ar
19 # - cc 20 # - cc
20 # - cxx 21 # - cxx
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 if (defined(invoker.toolprefix)) { 479 if (defined(invoker.toolprefix)) {
479 toolprefix = invoker.toolprefix 480 toolprefix = invoker.toolprefix
480 } else { 481 } else {
481 toolprefix = "" 482 toolprefix = ""
482 } 483 }
483 484
484 gcc_toolchain(target_name) { 485 gcc_toolchain(target_name) {
485 prefix = rebase_path("$clang_base_path/bin", root_build_dir) 486 prefix = rebase_path("$clang_base_path/bin", root_build_dir)
486 cc = "$prefix/clang" 487 cc = "$prefix/clang"
487 cxx = "$prefix/clang++" 488 cxx = "$prefix/clang++"
488 ld = cxx 489
490 if (use_clang_static_analyzer) {
sdefresne 2017/01/10 09:06:05 You'll also need to add this to build/toolchain/ma
491 # Call "ccc-analyzer" or "c++-analyzer" instead of directly calling Clang.
492 # |wrapper_tool| sets the environment variables which are read by the
493 # analyzer tools.
494 analyzer_wrapper =
495 rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py",
496 root_build_dir)
497 cc = analyzer_wrapper + " --clang-cc-path=${cc} --analyzer=" + rebase_path (
498 "//third_party/llvm/tools/clang/tools/scan-build/libexec/ccc-anal yzer",
499 root_build_dir)
500 cxx = analyzer_wrapper + " --clang-cxx-path=${cxx} --analyzer=" + rebase_p ath(
501 "//third_party/llvm/tools/clang/tools/scan-build/libexec/c++-ana lyzer",
502 root_build_dir)
503 }
489 504
490 readelf = "${toolprefix}readelf" 505 readelf = "${toolprefix}readelf"
491 ar = "${toolprefix}ar" 506 ar = "${toolprefix}ar"
492 nm = "${toolprefix}nm" 507 nm = "${toolprefix}nm"
508 ld = cxx
493 509
494 forward_variables_from(invoker, [ "strip" ]) 510 forward_variables_from(invoker, [ "strip" ])
495 511
496 toolchain_args = { 512 toolchain_args = {
497 if (defined(invoker.toolchain_args)) { 513 if (defined(invoker.toolchain_args)) {
498 forward_variables_from(invoker.toolchain_args, "*") 514 forward_variables_from(invoker.toolchain_args, "*")
499 } 515 }
500 is_clang = true 516 is_clang = true
501 } 517 }
502 } 518 }
503 } 519 }
OLDNEW
« no previous file with comments | « build/toolchain/clang_static_analyzer_wrapper.py ('k') | build/toolchain/wrapper_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698