Analyze support in gyp_webrtc
BUG=chromium:482463
TESTED=Manually tested using the JSON files attached to https://code.google.com/p/chromium/issues/detail?id=482463#c2 and:
webrtc/build/gyp_webrtc --analyzer nothing-files.json nothing-files-RESULT.json
webrtc/build/gyp_webrtc --analyzer everything-files.json everything-files-RESULT.json
webrtc/build/gyp_webrtc --analyzer test_support_unittests-files.json test_support_unittests-files-RESULT.json
Then I verified the result-json contained the expected output.
R=phoglund@webrtc.org
Review URL: https://codereview.webrtc.org/1369683004 .
Cr-Commit-Position: refs/heads/master@{#10097}
diff --git a/webrtc/build/gyp_webrtc b/webrtc/build/gyp_webrtc
index 2376cfb..cfe9ace 100755
--- a/webrtc/build/gyp_webrtc
+++ b/webrtc/build/gyp_webrtc
@@ -38,6 +38,13 @@
if __name__ == '__main__':
args = sys.argv[1:]
+ use_analyzer = len(args) and args[0] == '--analyzer'
+ if use_analyzer:
+ args.pop(0)
+ os.environ['GYP_GENERATORS'] = 'analyzer'
+ args.append('-Gconfig_path=' + args.pop(0))
+ args.append('-Ganalyzer_output_path=' + args.pop(0))
+
if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)):
print 'Skipping gyp_webrtc due to GYP_CHROMIUM_NO_ACTION env var.'
sys.exit(0)
@@ -100,13 +107,14 @@
# Set the gyp depth variable to the root of the checkout.
args.append('--depth=' + os.path.relpath(checkout_root))
- print 'Updating projects from gyp files...'
- sys.stdout.flush()
+ if not use_analyzer:
+ print 'Updating projects from gyp files...'
+ sys.stdout.flush()
# Off we go...
gyp_rc = gyp.main(args)
- if vs2013_runtime_dll_dirs:
+ if vs2013_runtime_dll_dirs and not use_analyzer:
x64_runtime, x86_runtime = vs2013_runtime_dll_dirs
vs_toolchain.CopyVsRuntimeDlls(
os.path.join(checkout_root, gyp_chromium.GetOutputDirectory()),