Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: pylib/gyp/xcode_emulation.py

Issue 10409007: mac ninja and make: Add support for GCC_ENABLE_OBJC_GC. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 Google Inc. All rights reserved. 1 # Copyright (c) 2012 Google Inc. 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 This module contains classes that help to emulate xcodebuild behavior on top of 6 This module contains classes that help to emulate xcodebuild behavior on top of
7 other build systems, such as make and ninja. 7 other build systems, such as make and ninja.
8 """ 8 """
9 9
10 import gyp.common 10 import gyp.common
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'): 299 if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'):
300 cflags.append('-Wnewline-eof') 300 cflags.append('-Wnewline-eof')
301 301
302 self._Appendf(cflags, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') 302 self._Appendf(cflags, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s')
303 303
304 # TODO: 304 # TODO:
305 if self._Test('COPY_PHASE_STRIP', 'YES', default='NO'): 305 if self._Test('COPY_PHASE_STRIP', 'YES', default='NO'):
306 self._WarnUnimplemented('COPY_PHASE_STRIP') 306 self._WarnUnimplemented('COPY_PHASE_STRIP')
307 self._WarnUnimplemented('GCC_DEBUGGING_SYMBOLS') 307 self._WarnUnimplemented('GCC_DEBUGGING_SYMBOLS')
308 self._WarnUnimplemented('GCC_ENABLE_OBJC_EXCEPTIONS') 308 self._WarnUnimplemented('GCC_ENABLE_OBJC_EXCEPTIONS')
309 self._WarnUnimplemented('GCC_ENABLE_OBJC_GC')
310 309
311 # TODO: This is exported correctly, but assigning to it is not supported. 310 # TODO: This is exported correctly, but assigning to it is not supported.
312 self._WarnUnimplemented('MACH_O_TYPE') 311 self._WarnUnimplemented('MACH_O_TYPE')
313 self._WarnUnimplemented('PRODUCT_TYPE') 312 self._WarnUnimplemented('PRODUCT_TYPE')
314 313
315 archs = self._Settings().get('ARCHS', ['i386']) 314 archs = self._Settings().get('ARCHS', ['i386'])
316 if len(archs) != 1: 315 if len(archs) != 1:
317 # TODO: Supporting fat binaries will be annoying. 316 # TODO: Supporting fat binaries will be annoying.
318 self._WarnUnimplemented('ARCHS') 317 self._WarnUnimplemented('ARCHS')
319 archs = ['i386'] 318 archs = ['i386']
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if flag in ('$OTHER_CFLAGS', '$(OTHER_CFLAGS)', '${OTHER_CFLAGS}'): 370 if flag in ('$OTHER_CFLAGS', '$(OTHER_CFLAGS)', '${OTHER_CFLAGS}'):
372 other_ccflags += self._Settings().get('OTHER_CFLAGS', []) 371 other_ccflags += self._Settings().get('OTHER_CFLAGS', [])
373 else: 372 else:
374 other_ccflags.append(flag) 373 other_ccflags.append(flag)
375 cflags_cc += other_ccflags 374 cflags_cc += other_ccflags
376 375
377 self.configname = None 376 self.configname = None
378 return cflags_cc 377 return cflags_cc
379 378
380 def GetCflagsObjC(self, configname): 379 def GetCflagsObjC(self, configname):
381 """Returns flags that need to be added to .m compilations.""" 380 """Returns flags that need to be added to .m and .mm compilations."""
382 self.configname = configname 381 self.configname = configname
382 cflags_objc = []
383
384 gc_policy = self._Settings().get('GCC_ENABLE_OBJC_GC', 'unsupported')
385 if gc_policy == 'supported':
386 cflags_objc.append('-fobjc-gc')
387 elif gc_policy == 'required':
388 cflags_objc.append('-fobjc-gc-only')
389
383 self.configname = None 390 self.configname = None
384 return [] 391 return cflags_objc
385 392
386 def GetCflagsObjCC(self, configname): 393 def GetCflagsObjCC(self, configname):
387 """Returns flags that need to be added to .mm compilations.""" 394 """Returns flags that need to be added to .mm compilations."""
388 self.configname = configname 395 self.configname = configname
389 cflags_objcc = [] 396 cflags_objcc = []
390 if self._Test('GCC_OBJC_CALL_CXX_CDTORS', 'YES', default='NO'): 397 if self._Test('GCC_OBJC_CALL_CXX_CDTORS', 'YES', default='NO'):
391 cflags_objcc.append('-fobjc-call-cxx-cdtors') 398 cflags_objcc.append('-fobjc-call-cxx-cdtors')
392 self.configname = None 399 self.configname = None
393 return cflags_objcc 400 return cflags_objcc
394 401
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 def GetSpecPostbuildCommands(spec, quiet=False): 1015 def GetSpecPostbuildCommands(spec, quiet=False):
1009 """Returns the list of postbuilds explicitly defined on |spec|, in a form 1016 """Returns the list of postbuilds explicitly defined on |spec|, in a form
1010 executable by a shell.""" 1017 executable by a shell."""
1011 postbuilds = [] 1018 postbuilds = []
1012 for postbuild in spec.get('postbuilds', []): 1019 for postbuild in spec.get('postbuilds', []):
1013 if not quiet: 1020 if not quiet:
1014 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( 1021 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % (
1015 spec['target_name'], postbuild['postbuild_name'])) 1022 spec['target_name'], postbuild['postbuild_name']))
1016 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) 1023 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action']))
1017 return postbuilds 1024 return postbuilds
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698