forked from qt-creator/qt-creator
Qbs: Set cpp.xcodeSdkName and cpp.xcodeSdkVersion.
Change-Id: I17ef8c60589208810e9427187249b7a56c46b623 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <tools/hostosinfo.h>
|
#include <tools/hostosinfo.h>
|
||||||
|
|
||||||
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
@@ -60,8 +61,10 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(k, return defaultData);
|
QTC_ASSERT(k, return defaultData);
|
||||||
QVariantMap data = defaultData;
|
QVariantMap data = defaultData;
|
||||||
|
|
||||||
|
const QString sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput();
|
||||||
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k))
|
if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k))
|
||||||
data.insert(QLatin1String(QBS_SYSROOT), ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput());
|
data.insert(QLatin1String(QBS_SYSROOT), sysroot);
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
||||||
if (tc) {
|
if (tc) {
|
||||||
@@ -122,6 +125,14 @@ QVariantMap DefaultPropertyProvider::properties(const ProjectExplorer::Kit *k, c
|
|||||||
<< QLatin1String("llvm")
|
<< QLatin1String("llvm")
|
||||||
<< QLatin1String("gcc"));
|
<< QLatin1String("gcc"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set Xcode SDK name and version - required by Qbs if a sysroot is present
|
||||||
|
// Ideally this would be done in a better way...
|
||||||
|
QRegExp re(QLatin1String("(MacOSX|iPhoneOS|iPhoneSimulator)([0-9]+\\.[0-9]+)\\.sdk"));
|
||||||
|
if (re.exactMatch(QDir(sysroot).dirName())) {
|
||||||
|
data.insert(QLatin1String(CPP_XCODESDKNAME), re.cap(1).toLower() + re.cap(2));
|
||||||
|
data.insert(QLatin1String(CPP_XCODESDKVERSION), re.cap(2));
|
||||||
|
}
|
||||||
} else if (targetAbi.os() == ProjectExplorer::Abi::LinuxOS) {
|
} else if (targetAbi.os() == ProjectExplorer::Abi::LinuxOS) {
|
||||||
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("linux")
|
data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("linux")
|
||||||
<< QLatin1String("unix"));
|
<< QLatin1String("unix"));
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";
|
|||||||
const char CPP_COMPILERNAME[] = "cpp.compilerName";
|
const char CPP_COMPILERNAME[] = "cpp.compilerName";
|
||||||
const char CPP_PLATFORMCFLAGS[] = "cpp.platformCFlags";
|
const char CPP_PLATFORMCFLAGS[] = "cpp.platformCFlags";
|
||||||
const char CPP_PLATFORMCXXFLAGS[] = "cpp.platformCxxFlags";
|
const char CPP_PLATFORMCXXFLAGS[] = "cpp.platformCxxFlags";
|
||||||
|
const char CPP_XCODESDKNAME[] = "cpp.xcodeSdkName";
|
||||||
|
const char CPP_XCODESDKVERSION[] = "cpp.xcodeSdkVersion";
|
||||||
|
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
} // namespace QbsProjectManager
|
} // namespace QbsProjectManager
|
||||||
|
|||||||
Reference in New Issue
Block a user