Skip to content

Commit

Permalink
Add clang static analysis support to gn wrapper (flutter#8047)
Browse files Browse the repository at this point in the history
Adds --clang-static-analysis option to GN to enable/disable compiling
with clang static analysis enabled.
  • Loading branch information
cbracken authored Mar 6, 2019
1 parent b30f989 commit 70a18b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ allowed_hosts = [
]

deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '7f64ff4928e7106cd8d81c6397fba4b7c1cdbb96',
'src': 'https://github.com/flutter/buildroot.git' + '@' + '4a12b0dfad16723b2190b697a669e3ae17b50b35',

# Fuchsia compatibility
#
Expand Down
8 changes: 8 additions & 0 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ def to_gn_args(args):
gn_args['android_full_debug'] = args.target_os == 'android' and args.unoptimized
gn_args['is_clang'] = not sys.platform.startswith(('cygwin', 'win'))

if not sys.platform.startswith(('cygwin', 'win')):
gn_args['use_clang_static_analyzer'] = args.clang_static_analyzer
else:
gn_args['use_clang_static_analyzer'] = False

gn_args['embedder_for_target'] = args.embedder_for_target

gn_args['enable_coverage'] = args.coverage
Expand Down Expand Up @@ -261,6 +266,9 @@ def parse_args(args):
parser.add_argument('--clang', default=True, action='store_true')
parser.add_argument('--no-clang', dest='clang', action='store_false')

parser.add_argument('--clang-static-analyzer', default=False, action='store_true')
parser.add_argument('--no-clang-static-analyzer', dest='clang_static_analyzer', action='store_false')

parser.add_argument('--target-sysroot', type=str)
parser.add_argument('--target-toolchain', type=str)
parser.add_argument('--target-triple', type=str)
Expand Down

0 comments on commit 70a18b5

Please sign in to comment.