OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import os | 5 import os |
6 import sys | 6 import sys |
7 | 7 |
8 from recipe_engine.config import config_item_context, ConfigGroup | 8 from recipe_engine.config import config_item_context, ConfigGroup |
9 from recipe_engine.config import Dict, Set, Single, Static | 9 from recipe_engine.config import Dict, Set, Single, Static |
10 from recipe_engine.config_types import Path | 10 from recipe_engine.config_types import Path |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 env = {} | 48 env = {} |
49 if builder_dict.get('compiler') == 'Clang': | 49 if builder_dict.get('compiler') == 'Clang': |
50 env['CC'] = '/usr/bin/clang' | 50 env['CC'] = '/usr/bin/clang' |
51 env['CXX'] = '/usr/bin/clang++' | 51 env['CXX'] = '/usr/bin/clang++' |
52 return env | 52 return env |
53 | 53 |
54 | 54 |
55 def gyp_defs_from_builder_dict(builder_dict): | 55 def gyp_defs_from_builder_dict(builder_dict): |
56 gyp_defs = {} | 56 gyp_defs = {} |
57 | 57 |
58 # skia_arch_width. | 58 # skia_arch_type. |
59 if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_BUILD: | 59 if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_BUILD: |
60 arch = builder_dict['target_arch'] | 60 arch = builder_dict['target_arch'] |
61 elif builder_dict['role'] == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | 61 elif builder_dict['role'] == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
62 arch = None | 62 arch = None |
63 else: | 63 else: |
64 arch = builder_dict['arch'] | 64 arch = builder_dict['arch'] |
65 | 65 |
66 #TODO(scroggo + mtklein): when safe, only set skia_arch_type | 66 arch_types = { |
67 arch_widths_and_types = { | 67 'x86': 'x86', |
68 'x86': ('32', 'x86'), | 68 'x86_64': 'x86_64', |
69 'x86_64': ('64', 'x86_64'), | 69 'Arm7': 'arm', |
70 'Arm7': ('32', 'arm'), | 70 'Arm64': 'arm64', |
71 'Arm64': ('64', 'arm64'), | 71 'Mips': 'mips32', |
72 'Mips': ('32', 'mips'), | 72 'Mips64': 'mips64', |
73 'Mips64': ('64', 'mips'), | 73 'MipsDSP2': 'mips32', |
74 'MipsDSP2': ('32', 'mips'), | |
75 } | 74 } |
76 if arch in arch_widths_and_types: | 75 if arch in arch_types: |
77 skia_arch_width, skia_arch_type = arch_widths_and_types[arch] | 76 gyp_defs['skia_arch_type'] = arch_types[arch] |
78 gyp_defs['skia_arch_width'] = skia_arch_width | |
79 gyp_defs['skia_arch_type'] = skia_arch_type | |
80 | 77 |
81 # housekeeper: build shared lib. | 78 # housekeeper: build shared lib. |
82 if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: | 79 if builder_dict['role'] == builder_name_schema.BUILDER_ROLE_HOUSEKEEPER: |
83 gyp_defs['skia_shared_lib'] = '1' | 80 gyp_defs['skia_shared_lib'] = '1' |
84 | 81 |
85 # skia_gpu. | 82 # skia_gpu. |
86 if builder_dict.get('cpu_or_gpu') == 'CPU': | 83 if builder_dict.get('cpu_or_gpu') == 'CPU': |
87 gyp_defs['skia_gpu'] = '0' | 84 gyp_defs['skia_gpu'] = '0' |
88 | 85 |
89 # skia_warnings_as_errors. | 86 # skia_warnings_as_errors. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 (c.role == builder_name_schema.BUILDER_ROLE_TEST and | 195 (c.role == builder_name_schema.BUILDER_ROLE_TEST and |
199 c.configuration == CONFIG_DEBUG) or | 196 c.configuration == CONFIG_DEBUG) or |
200 'Valgrind' in c.BUILDER_NAME) | 197 'Valgrind' in c.BUILDER_NAME) |
201 c.gyp_env.GYP_DEFINES.update(gyp_defs_from_builder_dict(c.builder_cfg)) | 198 c.gyp_env.GYP_DEFINES.update(gyp_defs_from_builder_dict(c.builder_cfg)) |
202 c.is_trybot = builder_name_schema.IsTrybot(c.BUILDER_NAME) | 199 c.is_trybot = builder_name_schema.IsTrybot(c.BUILDER_NAME) |
203 c.extra_env_vars = get_extra_env_vars(c.builder_cfg) | 200 c.extra_env_vars = get_extra_env_vars(c.builder_cfg) |
204 arch = (c.builder_cfg.get('arch') or c.builder_cfg.get('target_arch')) | 201 arch = (c.builder_cfg.get('arch') or c.builder_cfg.get('target_arch')) |
205 if ('Win' in c.builder_cfg.get('os', '') and arch == 'x86_64'): | 202 if ('Win' in c.builder_cfg.get('os', '') and arch == 'x86_64'): |
206 c.configuration += '_x64' | 203 c.configuration += '_x64' |
207 | 204 |
OLD | NEW |