diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-11-04 11:53:26 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2013-11-04 18:17:43 +0100 |
commit | 77aa5c04f913718fded6d3fb4f83dfc2d065dc5b (patch) | |
tree | a6f6bab8a1158f910b0fea4f88ce6edbba827a01 | |
parent | 7acc7a89b0f05e48a8ccc80925a65c87ad873c87 (diff) |
ios: use the installed SDK instead of hardcoding it
-rw-r--r-- | config/cross-ios-arm7.cbc | 1 | ||||
-rw-r--r-- | config/cross-ios-universal.cbc | 1 | ||||
-rw-r--r-- | config/cross-ios-x86.cbc | 1 | ||||
-rw-r--r-- | config/ios.config | 38 |
4 files changed, 24 insertions, 17 deletions
diff --git a/config/cross-ios-arm7.cbc b/config/cross-ios-arm7.cbc index f8d623bf..f3e02a36 100644 --- a/config/cross-ios-arm7.cbc +++ b/config/cross-ios-arm7.cbc @@ -3,4 +3,3 @@ from cerbero.config import Platform, Architecture, Distro, DistroVersion target_platform=Platform.IOS target_arch=Architecture.ARMv7 target_distro=Distro.IOS -target_distro_version=DistroVersion.IOS_7_0 diff --git a/config/cross-ios-universal.cbc b/config/cross-ios-universal.cbc index 77a1f91e..2d914abc 100644 --- a/config/cross-ios-universal.cbc +++ b/config/cross-ios-universal.cbc @@ -3,5 +3,4 @@ from cerbero.config import Platform, Architecture, Distro, DistroVersion target_platform=Platform.IOS target_arch=Architecture.UNIVERSAL target_distro=Distro.IOS -target_distro_version=DistroVersion.IOS_7_0 universal_archs=[Architecture.ARMv7, Architecture.X86] diff --git a/config/cross-ios-x86.cbc b/config/cross-ios-x86.cbc index 7e883d00..64877405 100644 --- a/config/cross-ios-x86.cbc +++ b/config/cross-ios-x86.cbc @@ -3,4 +3,3 @@ from cerbero.config import Platform, Architecture, Distro, DistroVersion target_platform=Platform.IOS target_arch=Architecture.X86 target_distro=Distro.IOS -target_distro_version=DistroVersion.IOS_7_0 diff --git a/config/ios.config b/config/ios.config index a12936e7..18950ae0 100644 --- a/config/ios.config +++ b/config/ios.config @@ -17,24 +17,34 @@ allow_system_libs=False # effectively be 6.0 without making it crash min_version='5.1' -if target_distro_version == DistroVersion.IOS_6_0: - v = '6.0' -elif target_distro_version == DistroVersion.IOS_6_1: - v = '6.1' -elif target_distro_version == DistroVersion.IOS_7_0: - v = '7.0' -else: - raise FatalError("Distro version %s not supported" %(target_distro_version)) +if target_distro_version == distro_version: + target_distro_version = None -if not ios_platform: - if target_arch == Architecture.X86: - ios_platform = 'iPhoneSimulator' - else: - ios_platform = 'iPhoneOS' +if target_arch == Architecture.X86: + ios_platform = 'iPhoneSimulator' +else: + ios_platform = 'iPhoneOS' iphone_platform = '/Applications/Xcode.app/Contents/Developer/Platforms/%s.platform/Developer' % ios_platform _toolchain_root = '%s/usr/bin' % iphone_platform -sysroot = os.path.join(iphone_platform, 'SDKs', '%s%s.sdk' %(ios_platform, v)) + +# Find the installed SDK +_sdk_version = None +for d,v in [(DistroVersion.IOS_7_0, '7.0'), + (DistroVersion.IOS_6_1, '6.1'), + (DistroVersion.IOS_6_0, '6.0')]: + sysroot = os.path.join(iphone_platform, 'SDKs', '%s%s.sdk' %(ios_platform, v)) + if os.path.exists (sysroot): + _sdk_version = d + break + +if target_distro_version is not None and target_distro_version != _sdk_version: + raise FatalError("The SDK for %s is not installed" % target_distro_version) +elif _sdk_version is None: + raise FatalError("The SDK for iOS could not be found in your system") +else: + target_distro_version = _sdk_version + ccache = use_ccache and 'ccache ' or '' extra_cflags='-Wall -g -Os' |