#5699 Add Mac deploy argument in configure command

If deploy target is not specified, it would use the specified sdk
version
This commit is contained in:
Jerry (Xinyu Hou) 2016-10-31 17:40:54 +00:00
parent 6a7703f229
commit 340ee43d90
1 changed files with 17 additions and 4 deletions

View File

@ -41,7 +41,7 @@ class Toolchain:
cmd_opt_dict = { cmd_opt_dict = {
'about' : ['', []], 'about' : ['', []],
'setup' : ['g:', ['generator=']], 'setup' : ['g:', ['generator=']],
'configure' : ['g:dr', ['generator=', 'debug', 'release', 'mac-sdk=', 'mac-identity=']], 'configure' : ['g:dr', ['generator=', 'debug', 'release', 'mac-sdk=', 'mac-deploy=', 'mac-identity=']],
'build' : ['dr', ['debug', 'release']], 'build' : ['dr', ['debug', 'release']],
'clean' : ['dr', ['debug', 'release']], 'clean' : ['dr', ['debug', 'release']],
'update' : ['', []], 'update' : ['', []],
@ -244,6 +244,9 @@ class InternalCommands:
# by default, unknown # by default, unknown
macSdk = None macSdk = None
# by default, unknown
macDeploy = None
# by default, unknown # by default, unknown
macIdentity = None macIdentity = None
@ -365,7 +368,7 @@ class InternalCommands:
# ensure latest setup and do not ask config for generator (only fall # ensure latest setup and do not ask config for generator (only fall
# back to prompt if not specified as arg) # back to prompt if not specified as arg)
self.ensure_setup_latest() self.ensure_setup_latest()
if sys.platform == "darwin": if sys.platform == "darwin":
config = self.getConfig() config = self.getConfig()
@ -374,6 +377,11 @@ class InternalCommands:
elif config.has_option("hm", "macSdk"): elif config.has_option("hm", "macSdk"):
self.macSdk = config.get('hm', 'macSdk') self.macSdk = config.get('hm', 'macSdk')
if self.macDeploy:
config.set('hm', 'macDeploy', self.macDeploy)
elif config.has_option("hm", "macDeploy"):
self.macSdk = config.get('hm', 'macDeploy')
if self.macIdentity: if self.macIdentity:
config.set('hm', 'macIdentity', self.macIdentity) config.set('hm', 'macIdentity', self.macIdentity)
elif config.has_option("hm", "macIdentity"): elif config.has_option("hm", "macIdentity"):
@ -383,7 +391,10 @@ class InternalCommands:
if not self.macSdk: if not self.macSdk:
raise Exception("Arg missing: --mac-sdk <version>"); raise Exception("Arg missing: --mac-sdk <version>");
if not self.macDeploy:
self.macDeploy = self.macSdk
if not self.macIdentity: if not self.macIdentity:
raise Exception("Arg missing: --mac-identity <name>"); raise Exception("Arg missing: --mac-identity <name>");
@ -438,7 +449,7 @@ class InternalCommands:
if generator.cmakeName.find('Unix Makefiles') == -1: if generator.cmakeName.find('Unix Makefiles') == -1:
sdkDir = self.getMacSdkDir() sdkDir = self.getMacSdkDir()
cmake_args += " -DCMAKE_OSX_SYSROOT=" + sdkDir cmake_args += " -DCMAKE_OSX_SYSROOT=" + sdkDir
cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macSdk cmake_args += " -DCMAKE_OSX_DEPLOYMENT_TARGET=" + self.macDeploy
cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1) cmake_args += " -DOSX_TARGET_MAJOR=" + macSdkMatch.group(1)
cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2) cmake_args += " -DOSX_TARGET_MINOR=" + macSdkMatch.group(2)
@ -1898,6 +1909,8 @@ class CommandHandler:
self.qtDir = a self.qtDir = a
elif o == '--mac-sdk': elif o == '--mac-sdk':
self.ic.macSdk = a self.ic.macSdk = a
elif o == '--mac-deploy':
self.ic.macDeploy = a
elif o == '--mac-identity': elif o == '--mac-identity':
self.ic.macIdentity = a self.ic.macIdentity = a