| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 json | 5 import json |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 import buildbot_common | 9 import buildbot_common |
| 10 import build_version | 10 import build_version |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 if not os.path.exists(dst_path): | 182 if not os.path.exists(dst_path): |
| 183 buildbot_common.MakeDir(dst_path) | 183 buildbot_common.MakeDir(dst_path) |
| 184 buildbot_common.CopyFile(src_file, dst_file) | 184 buildbot_common.CopyFile(src_file, dst_file) |
| 185 | 185 |
| 186 | 186 |
| 187 def ModifyDescInPlace(desc): | 187 def ModifyDescInPlace(desc): |
| 188 """Perform post-load processing on .dsc file data. | 188 """Perform post-load processing on .dsc file data. |
| 189 | 189 |
| 190 Currently this consists of: | 190 Currently this consists of: |
| 191 - Add -Wall to CXXFLAGS | 191 - Add -Wall to CXXFLAGS |
| 192 - Synthesize SEL_LDR_LIBS and SEL_LDR_DEPS by stripping | |
| 193 down LIBS and DEPS (removing certain ppapi-only libs). | |
| 194 """ | 192 """ |
| 195 | 193 |
| 196 ppapi_only_libs = ['ppapi_simple'] | |
| 197 | |
| 198 for target in desc['TARGETS']: | 194 for target in desc['TARGETS']: |
| 199 target.setdefault('CXXFLAGS', []) | 195 target.setdefault('CXXFLAGS', []) |
| 200 target['CXXFLAGS'].insert(0, '-Wall') | 196 target['CXXFLAGS'].insert(0, '-Wall') |
| 201 | 197 |
| 202 def filter_out(key): | |
| 203 value = target.get(key, []) | |
| 204 if type(value) == dict: | |
| 205 value = dict(value) | |
| 206 for key in value.keys(): | |
| 207 value[key] = [v for v in value[key] if v not in ppapi_only_libs] | |
| 208 else: | |
| 209 value = [v for v in value if v not in ppapi_only_libs] | |
| 210 return value | |
| 211 | |
| 212 target['SEL_LDR_LIBS'] = filter_out('LIBS') | |
| 213 target['SEL_LDR_DEPS'] = filter_out('DEPS') | |
| 214 | |
| 215 | 198 |
| 216 def ProcessProject(pepperdir, srcroot, dstroot, desc, toolchains, configs=None, | 199 def ProcessProject(pepperdir, srcroot, dstroot, desc, toolchains, configs=None, |
| 217 first_toolchain=False): | 200 first_toolchain=False): |
| 218 if not configs: | 201 if not configs: |
| 219 configs = ['Debug', 'Release'] | 202 configs = ['Debug', 'Release'] |
| 220 | 203 |
| 221 name = desc['NAME'] | 204 name = desc['NAME'] |
| 222 out_dir = os.path.join(dstroot, desc['DEST'], name) | 205 out_dir = os.path.join(dstroot, desc['DEST'], name) |
| 223 buildbot_common.MakeDir(out_dir) | 206 buildbot_common.MakeDir(out_dir) |
| 224 srcdirs = desc.get('SEARCH', ['.', SDK_RESOURCE_DIR]) | 207 srcdirs = desc.get('SEARCH', ['.', SDK_RESOURCE_DIR]) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) | 273 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) |
| 291 template_dict = { | 274 template_dict = { |
| 292 'projects': targets, | 275 'projects': targets, |
| 293 'deps' : deps, | 276 'deps' : deps, |
| 294 'rel_sdk' : rel_path, | 277 'rel_sdk' : rel_path, |
| 295 } | 278 } |
| 296 RunTemplateFileIfChanged(in_path, out_path, template_dict) | 279 RunTemplateFileIfChanged(in_path, out_path, template_dict) |
| 297 outdir = os.path.dirname(os.path.abspath(out_path)) | 280 outdir = os.path.dirname(os.path.abspath(out_path)) |
| 298 if getos.GetPlatform() == 'win': | 281 if getos.GetPlatform() == 'win': |
| 299 AddMakeBat(pepperdir, outdir) | 282 AddMakeBat(pepperdir, outdir) |
| OLD | NEW |