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 gyp.common | 10 import gyp.common |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 out.rstrip(), 'Platforms/MacOSX.platform/Developer/SDKs') | 237 out.rstrip(), 'Platforms/MacOSX.platform/Developer/SDKs') |
238 if os.path.isdir(xcode43_sdk_path): | 238 if os.path.isdir(xcode43_sdk_path): |
239 XcodeSettings._sdk_base_dir = xcode43_sdk_path | 239 XcodeSettings._sdk_base_dir = xcode43_sdk_path |
240 else: | 240 else: |
241 XcodeSettings._sdk_base_dir = os.path.join(out.rstrip(), 'SDKs') | 241 XcodeSettings._sdk_base_dir = os.path.join(out.rstrip(), 'SDKs') |
242 return XcodeSettings._sdk_base_dir | 242 return XcodeSettings._sdk_base_dir |
243 | 243 |
244 def _SdkPath(self): | 244 def _SdkPath(self): |
245 sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx10.5') | 245 sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx10.5') |
246 if sdk_root.startswith('macosx'): | 246 if sdk_root.startswith('macosx'): |
247 sdk_root = 'MacOSX' + sdk_root[len('macosx'):] | 247 return os.path.join(self._GetSdkBaseDir(), |
248 return os.path.join(self._GetSdkBaseDir(), '%s.sdk' % sdk_root) | 248 'MacOSX' + sdk_root[len('macosx'):] + '.sdk') |
| 249 return sdk_root |
249 | 250 |
250 def GetCflags(self, configname): | 251 def GetCflags(self, configname): |
251 """Returns flags that need to be added to .c, .cc, .m, and .mm | 252 """Returns flags that need to be added to .c, .cc, .m, and .mm |
252 compilations.""" | 253 compilations.""" |
253 # This functions (and the similar ones below) do not offer complete | 254 # This functions (and the similar ones below) do not offer complete |
254 # emulation of all xcode_settings keys. They're implemented on demand. | 255 # emulation of all xcode_settings keys. They're implemented on demand. |
255 | 256 |
256 self.configname = configname | 257 self.configname = configname |
257 cflags = [] | 258 cflags = [] |
258 | 259 |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 def GetSpecPostbuildCommands(spec, quiet=False): | 1035 def GetSpecPostbuildCommands(spec, quiet=False): |
1035 """Returns the list of postbuilds explicitly defined on |spec|, in a form | 1036 """Returns the list of postbuilds explicitly defined on |spec|, in a form |
1036 executable by a shell.""" | 1037 executable by a shell.""" |
1037 postbuilds = [] | 1038 postbuilds = [] |
1038 for postbuild in spec.get('postbuilds', []): | 1039 for postbuild in spec.get('postbuilds', []): |
1039 if not quiet: | 1040 if not quiet: |
1040 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( | 1041 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( |
1041 spec['target_name'], postbuild['postbuild_name'])) | 1042 spec['target_name'], postbuild['postbuild_name'])) |
1042 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) | 1043 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) |
1043 return postbuilds | 1044 return postbuilds |
OLD | NEW |