| OLD | NEW |
| 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 copy | 10 import copy |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 gc_policy = self._Settings().get('GCC_ENABLE_OBJC_GC', 'unsupported') | 462 gc_policy = self._Settings().get('GCC_ENABLE_OBJC_GC', 'unsupported') |
| 463 if gc_policy == 'supported': | 463 if gc_policy == 'supported': |
| 464 flags.append('-fobjc-gc') | 464 flags.append('-fobjc-gc') |
| 465 elif gc_policy == 'required': | 465 elif gc_policy == 'required': |
| 466 flags.append('-fobjc-gc-only') | 466 flags.append('-fobjc-gc-only') |
| 467 | 467 |
| 468 def _AddObjectiveCARCFlags(self, flags): | 468 def _AddObjectiveCARCFlags(self, flags): |
| 469 if self._Test('CLANG_ENABLE_OBJC_ARC', 'YES', default='NO'): | 469 if self._Test('CLANG_ENABLE_OBJC_ARC', 'YES', default='NO'): |
| 470 flags.append('-fobjc-arc') | 470 flags.append('-fobjc-arc') |
| 471 | 471 |
| 472 def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): |
| 473 if self._Test('CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS', |
| 474 'YES', default='NO'): |
| 475 flags.append('-Wobjc-missing-property-synthesis') |
| 476 |
| 472 def GetCflagsObjC(self, configname): | 477 def GetCflagsObjC(self, configname): |
| 473 """Returns flags that need to be added to .m compilations.""" | 478 """Returns flags that need to be added to .m compilations.""" |
| 474 self.configname = configname | 479 self.configname = configname |
| 475 cflags_objc = [] | 480 cflags_objc = [] |
| 476 self._AddObjectiveCGarbageCollectionFlags(cflags_objc) | 481 self._AddObjectiveCGarbageCollectionFlags(cflags_objc) |
| 477 self._AddObjectiveCARCFlags(cflags_objc) | 482 self._AddObjectiveCARCFlags(cflags_objc) |
| 483 self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) |
| 478 self.configname = None | 484 self.configname = None |
| 479 return cflags_objc | 485 return cflags_objc |
| 480 | 486 |
| 481 def GetCflagsObjCC(self, configname): | 487 def GetCflagsObjCC(self, configname): |
| 482 """Returns flags that need to be added to .mm compilations.""" | 488 """Returns flags that need to be added to .mm compilations.""" |
| 483 self.configname = configname | 489 self.configname = configname |
| 484 cflags_objcc = [] | 490 cflags_objcc = [] |
| 485 self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) | 491 self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) |
| 486 self._AddObjectiveCARCFlags(cflags_objcc) | 492 self._AddObjectiveCARCFlags(cflags_objcc) |
| 493 self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) |
| 487 if self._Test('GCC_OBJC_CALL_CXX_CDTORS', 'YES', default='NO'): | 494 if self._Test('GCC_OBJC_CALL_CXX_CDTORS', 'YES', default='NO'): |
| 488 cflags_objcc.append('-fobjc-call-cxx-cdtors') | 495 cflags_objcc.append('-fobjc-call-cxx-cdtors') |
| 489 self.configname = None | 496 self.configname = None |
| 490 return cflags_objcc | 497 return cflags_objcc |
| 491 | 498 |
| 492 def GetInstallNameBase(self): | 499 def GetInstallNameBase(self): |
| 493 """Return DYLIB_INSTALL_NAME_BASE for this target.""" | 500 """Return DYLIB_INSTALL_NAME_BASE for this target.""" |
| 494 # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. | 501 # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. |
| 495 if (self.spec['type'] != 'shared_library' and | 502 if (self.spec['type'] != 'shared_library' and |
| 496 (self.spec['type'] != 'loadable_module' or self._IsBundle())): | 503 (self.spec['type'] != 'loadable_module' or self._IsBundle())): |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 new_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' | 1297 new_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' |
| 1291 target_dict['configurations'][new_config_name] = new_config_dict | 1298 target_dict['configurations'][new_config_name] = new_config_dict |
| 1292 return targets | 1299 return targets |
| 1293 | 1300 |
| 1294 def CloneConfigurationForDeviceAndEmulator(target_dicts): | 1301 def CloneConfigurationForDeviceAndEmulator(target_dicts): |
| 1295 """If |target_dicts| contains any iOS targets, automatically create -iphoneos | 1302 """If |target_dicts| contains any iOS targets, automatically create -iphoneos |
| 1296 targets for iOS device builds.""" | 1303 targets for iOS device builds.""" |
| 1297 if _HasIOSTarget(target_dicts): | 1304 if _HasIOSTarget(target_dicts): |
| 1298 return _AddIOSDeviceConfigurations(target_dicts) | 1305 return _AddIOSDeviceConfigurations(target_dicts) |
| 1299 return target_dicts | 1306 return target_dicts |
| OLD | NEW |