diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-08-14 03:21:33 -0700 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-14 11:32:03 +0000 |
commit | adc28c434853cf0fa17e95cc207e5a1c6eb761de (patch) | |
tree | 0939f88812e87d5c297e79f6763179d7d4936e5e | |
parent | b790a7aa74653bf3d9125b30f262c37e389ac131 (diff) |
Don't set the *_DEPLOYMENT_TARGET environment variables to empty string
This is a partial revert of a7247ff1cde96864243eba3bf5d36d6b5bded2d6,
which caused Qbs to set the *_DEPLOYMENT_TARGET environment variables to
the empty string if no value was provided for the deployment target.
The empty string causes problems for some tools like `strip`, which
passes the empty string verbatim to the -*_version_min flag of an
internal invocation of `ld`, which is not allowed.
Presumably the original intent was to influence the target platform that
the compiler would use, but this does not work (at least with current
toolchains) if the value is the empty string. It also shouldn't matter
since we use -target now, which explicitly states the platform. In that
case, the compiler will choose a minimum version internally if one is
not explicitly given.
Change-Id: I7d9f12bb52bf3289c0c5e3353a928c8cb0be9531
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | share/qbs/modules/cpp/DarwinGCC.qbs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs index c1c92e740..015fb71f5 100644 --- a/share/qbs/modules/cpp/DarwinGCC.qbs +++ b/share/qbs/modules/cpp/DarwinGCC.qbs @@ -182,14 +182,14 @@ UnixGCC { // Set the corresponding environment variable even if the minimum OS version is undefined, // because this indicates the default deployment target for that OS - if (qbs.targetOS.contains("ios")) - env["IPHONEOS_DEPLOYMENT_TARGET"] = minimumIosVersion || ""; - if (qbs.targetOS.contains("macos")) - env["MACOSX_DEPLOYMENT_TARGET"] = minimumMacosVersion || ""; - if (qbs.targetOS.contains("watchos")) - env["WATCHOS_DEPLOYMENT_TARGET"] = minimumWatchosVersion || ""; - if (qbs.targetOS.contains("tvos")) - env["TVOS_DEPLOYMENT_TARGET"] = minimumTvosVersion || ""; + if (qbs.targetOS.contains("ios") && minimumIosVersion) + env["IPHONEOS_DEPLOYMENT_TARGET"] = minimumIosVersion; + if (qbs.targetOS.contains("macos") && minimumMacosVersion) + env["MACOSX_DEPLOYMENT_TARGET"] = minimumMacosVersion; + if (qbs.targetOS.contains("watchos") && minimumWatchosVersion) + env["WATCHOS_DEPLOYMENT_TARGET"] = minimumWatchosVersion; + if (qbs.targetOS.contains("tvos") && minimumTvosVersion) + env["TVOS_DEPLOYMENT_TARGET"] = minimumTvosVersion; if (xcode.present) env["TARGETED_DEVICE_FAMILY"] = DarwinTools.targetedDeviceFamily(xcode.targetDevices); |