From 340ee43d90a87ba35375da106315a69c8baf0cfe Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Mon, 31 Oct 2016 17:40:54 +0000 Subject: [PATCH 1/4] #5699 Add Mac deploy argument in configure command If deploy target is not specified, it would use the specified sdk version --- ext/toolchain/commands1.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 9c28ab75..8e7910f9 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -41,7 +41,7 @@ class Toolchain: cmd_opt_dict = { 'about' : ['', []], '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']], 'clean' : ['dr', ['debug', 'release']], 'update' : ['', []], @@ -244,6 +244,9 @@ class InternalCommands: # by default, unknown macSdk = None + # by default, unknown + macDeploy = None + # by default, unknown macIdentity = None @@ -365,7 +368,7 @@ class InternalCommands: # ensure latest setup and do not ask config for generator (only fall # back to prompt if not specified as arg) self.ensure_setup_latest() - + if sys.platform == "darwin": config = self.getConfig() @@ -374,6 +377,11 @@ class InternalCommands: elif config.has_option("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: config.set('hm', 'macIdentity', self.macIdentity) elif config.has_option("hm", "macIdentity"): @@ -383,7 +391,10 @@ class InternalCommands: if not self.macSdk: raise Exception("Arg missing: --mac-sdk "); - + + if not self.macDeploy: + self.macDeploy = self.macSdk + if not self.macIdentity: raise Exception("Arg missing: --mac-identity "); @@ -438,7 +449,7 @@ class InternalCommands: if generator.cmakeName.find('Unix Makefiles') == -1: sdkDir = self.getMacSdkDir() 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_MINOR=" + macSdkMatch.group(2) @@ -1898,6 +1909,8 @@ class CommandHandler: self.qtDir = a elif o == '--mac-sdk': self.ic.macSdk = a + elif o == '--mac-deploy': + self.ic.macDeploy = a elif o == '--mac-identity': self.ic.macIdentity = a From 5cccac360c17b59d7613e3e32c43dca88e4162a6 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Wed, 2 Nov 2016 11:55:39 +0000 Subject: [PATCH 2/4] #5699 Add deploy target to GUI configure --- ext/toolchain/commands1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 8e7910f9..ceadb1fe 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -509,8 +509,8 @@ class InternalCommands: sdkDir = self.getMacSdkDir() shortForm = "macosx" + self.macSdk version = str(major) + "." + str(minor) - - qmake_cmd_string += " QMAKE_MACOSX_DEPLOYMENT_TARGET=" + version + + qmake_cmd_string += " QMAKE_MACOSX_DEPLOYMENT_TARGET=" + self.macDeploy (qMajor, qMinor, qRev) = self.getQmakeVersion() if qMajor <= 4: From f2f4b05c6f7a45395d04b8c0d5d3e00f20a7f543 Mon Sep 17 00:00:00 2001 From: Andrew Nelless Date: Thu, 3 Nov 2016 14:55:36 +0000 Subject: [PATCH 3/4] #5699 Only put MacOSX version number in filename when deploying for exact SDK --- ext/toolchain/commands1.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index ceadb1fe..b5a47217 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -1854,7 +1854,10 @@ class InternalCommands: # version is major and minor with no dots (e.g. 106) version = str(major) + str(minor) - return "MacOSX%s-%s" % (version, arch) + if (self.macDeploy == self.macSdk): + return "MacOSX%s-%s" % (version, arch) + else: + return "MacOSX-%s" % arch def reset(self): if os.path.exists('build'): From e6ca9e417dc9b54a042345b03a114f9fac330239 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 3 Nov 2016 16:42:38 +0000 Subject: [PATCH 4/4] #5699 load deploy target on load config so dist command is aware of it --- ext/toolchain/commands1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index b5a47217..cbfb31c7 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -667,6 +667,9 @@ class InternalCommands: if config.has_option("hm", "macSdk"): self.macSdk = config.get("hm", "macSdk") + + if config.has_option("hm", "macDeploy"): + self.macDeploy = config.get("hm", "macDeploy") if config.has_option("hm", "macIdentity"): self.macIdentity = config.get("hm", "macIdentity")