| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 gn_args["target_os"] = "android" | 73 gn_args["target_os"] = "android" |
| 74 elif config.target_os == Config.OS_FNL: | 74 elif config.target_os == Config.OS_FNL: |
| 75 gn_args["target_os"] = "fnl" | 75 gn_args["target_os"] = "fnl" |
| 76 gn_args["use_ozone"] = True | 76 gn_args["use_ozone"] = True |
| 77 gn_args["target_sysroot"] = config.values.get("target_sysroot", "") | 77 gn_args["target_sysroot"] = config.values.get("target_sysroot", "") |
| 78 gn_args["toolchain_prefix"] = config.values.get("toolchain_prefix", "") | 78 gn_args["toolchain_prefix"] = config.values.get("toolchain_prefix", "") |
| 79 elif config.target_os == Config.OS_IOS: | 79 elif config.target_os == Config.OS_IOS: |
| 80 gn_args["target_os"] = "ios" | 80 gn_args["target_os"] = "ios" |
| 81 gn_args["ios_deployment_target"] = "7.0" | 81 gn_args["ios_deployment_target"] = "7.0" |
| 82 gn_args["clang_use_chrome_plugins"] = False | 82 gn_args["clang_use_chrome_plugins"] = False |
| 83 if config.is_simulator: | |
| 84 gn_args["use_libjpeg_turbo"] = False | |
| 85 gn_args["use_ios_simulator"] = config.is_simulator | 83 gn_args["use_ios_simulator"] = config.is_simulator |
| 86 elif config.target_os == Config.OS_LINUX: | 84 elif config.target_os == Config.OS_LINUX: |
| 87 pass | 85 pass |
| 88 | 86 |
| 89 gn_args["target_cpu"] = config.target_cpu | 87 gn_args["target_cpu"] = config.target_cpu |
| 90 | 88 |
| 91 if "use_nacl" in config.values: | 89 if "use_nacl" in config.values: |
| 92 gn_args["mojo_use_nacl"] = config.values.get("use_nacl", False) | 90 gn_args["mojo_use_nacl"] = config.values.get("use_nacl", False) |
| 93 | 91 |
| 94 if "mojo_use_go" in config.values: | 92 if "mojo_use_go" in config.values: |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 values = {} | 156 values = {} |
| 159 with open(gn_file, "r") as f: | 157 with open(gn_file, "r") as f: |
| 160 for line in f.readlines(): | 158 for line in f.readlines(): |
| 161 line = re.sub("\s*#.*", "", line) | 159 line = re.sub("\s*#.*", "", line) |
| 162 result = re.match("^\s*(\w+)\s*=\s*(.*)\s*$", line) | 160 result = re.match("^\s*(\w+)\s*=\s*(.*)\s*$", line) |
| 163 if result: | 161 if result: |
| 164 key = result.group(1) | 162 key = result.group(1) |
| 165 value = result.group(2) | 163 value = result.group(2) |
| 166 values[key] = ast.literal_eval(TRANSLATIONS.get(value, value)) | 164 values[key] = ast.literal_eval(TRANSLATIONS.get(value, value)) |
| 167 return values | 165 return values |
| OLD | NEW |