Index: build/gyp_chromium |
diff --git a/build/gyp_chromium b/build/gyp_chromium |
index 11125751a0e5b0e515741ee8d18cd96c608a40e0..cd5cd43d3a6f6dd715d6829542111aec654b38fa 100755 |
--- a/build/gyp_chromium |
+++ b/build/gyp_chromium |
@@ -143,11 +143,26 @@ def GetOutputDirectory(): |
"""Returns the output directory that GYP will use.""" |
# GYP generator flags from the command line. We can't use optparse since we |
# want to ignore all arguments other than "-G". |
scottmg
2015/02/03 00:21:32
I'm a little skeptical of this comment (though sin
Sam Clegg
2015/02/03 01:20:10
Done.
|
- needle = '-Goutput_dir=' |
- cmdline_input_items = [] |
+ flag = '-G' |
+ found_flag = False |
+ needle = 'output_dir=' |
for item in sys.argv[1:]: |
- if item.startswith(needle): |
- return item[len(needle):] |
+ if item == flag: |
+ found_flag = True |
+ continue |
+ |
+ # Handle the two flag case (['-G', 'output_dir=foo']) |
+ if found_flag: |
+ found_flag = False |
+ if item.startswith(needle): |
+ return item[len(needle):] |
+ continue |
+ |
+ # Handle the single flag case (['-Goutput_dir=foo']) |
+ if item.startswith(flag): |
+ item = item[len(flag):] |
+ if item.startswith(needle): |
+ return item[len(needle):] |
env_items = shlex.split(os.environ.get('GYP_GENERATOR_FLAGS', '')) |
needle = 'output_dir=' |
@@ -155,7 +170,7 @@ def GetOutputDirectory(): |
if item.startswith(needle): |
return item[len(needle):] |
- return "out" |
+ return 'out' |
def additional_include_files(supplemental_files, args=[]): |