OLD | NEW |
---|---|
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 """ | 5 """ |
6 GN-related configuration functions, e.g., to produce a Config object from a GN | 6 GN-related configuration functions, e.g., to produce a Config object from a GN |
7 args.gn file). | 7 args.gn file). |
8 """ | 8 """ |
9 | 9 |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 gn_args["use_glib"] = False | 67 gn_args["use_glib"] = False |
68 gn_args["use_system_harfbuzz"] = False | 68 gn_args["use_system_harfbuzz"] = False |
69 elif config.target_os == Config.OS_LINUX: | 69 elif config.target_os == Config.OS_LINUX: |
70 gn_args["is_desktop_linux"] = False | 70 gn_args["is_desktop_linux"] = False |
71 gn_args["use_aura"] = False | 71 gn_args["use_aura"] = False |
72 gn_args["use_glib"] = False | 72 gn_args["use_glib"] = False |
73 gn_args["use_system_harfbuzz"] = False | 73 gn_args["use_system_harfbuzz"] = False |
74 | 74 |
75 gn_args["target_cpu"] = config.target_cpu | 75 gn_args["target_cpu"] = config.target_cpu |
76 | 76 |
77 val = config.values.get("self_built_network_service_location") | |
qsr
2015/03/09 11:58:41
I don't think you want this here. Any reason you w
haltonhuo
2015/03/09 12:13:00
Yes, it is needed, otherwise the "gn gen --args" c
qsr
2015/03/09 13:13:06
You do not want to have anything about this variab
haltonhuo
2015/03/10 06:50:44
Done in patch set 6
| |
78 if (val): | |
79 gn_args["self_built_network_service_location"] = val | |
80 | |
77 return gn_args | 81 return gn_args |
78 | 82 |
79 | 83 |
80 def CommandLineForGNArgs(gn_args): | 84 def CommandLineForGNArgs(gn_args): |
81 """ | 85 """ |
82 Returns the list of gn arguments to use with the gn command line. | 86 Returns the list of gn arguments to use with the gn command line. |
83 """ | 87 """ |
84 def _ToCommandLine(key, value): | 88 def _ToCommandLine(key, value): |
85 if type(value) is bool: | 89 if type(value) is bool: |
86 return "%s=%s" % (key, "true" if value else "false") | 90 return "%s=%s" % (key, "true" if value else "false") |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 values = {} | 125 values = {} |
122 with open(gn_file, "r") as f: | 126 with open(gn_file, "r") as f: |
123 for line in f.readlines(): | 127 for line in f.readlines(): |
124 line = re.sub("\s*#.*", "", line) | 128 line = re.sub("\s*#.*", "", line) |
125 result = re.match("^\s*(\w+)\s*=\s*(.*)\s*$", line) | 129 result = re.match("^\s*(\w+)\s*=\s*(.*)\s*$", line) |
126 if result: | 130 if result: |
127 key = result.group(1) | 131 key = result.group(1) |
128 value = result.group(2) | 132 value = result.group(2) |
129 values[key] = ast.literal_eval(TRANSLATIONS.get(value, value)) | 133 values[key] = ast.literal_eval(TRANSLATIONS.get(value, value)) |
130 return values | 134 return values |
OLD | NEW |