Beispiel #1
0
QStringList IosBuildStep::defaultArguments() const
{
    QStringList res;
    Kit *kit = target()->kit();
    ToolChain *tc = ToolChainKitInformation::toolChain(kit);
    switch (target()->activeBuildConfiguration()->buildType()) {
    case BuildConfiguration::Debug :
        res << QLatin1String("-configuration") << QLatin1String("Debug");
        break;
    case BuildConfiguration::Release :
        res << QLatin1String("-configuration") << QLatin1String("Release");
        break;
    case BuildConfiguration::Unknown :
        break;
    default:
        qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
                          << target()->activeBuildConfiguration()->buildType();
    }
    if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
            || tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) {
        GccToolChain *gtc = static_cast<GccToolChain *>(tc);
        res << gtc->platformCodeGenFlags();
    }
    if (!SysRootKitInformation::sysRoot(kit).isEmpty())
        res << QLatin1String("-sdk") << SysRootKitInformation::sysRoot(kit).toString();
    res << QLatin1String("SYMROOT=") + IosManager::resDirForTarget(target());
    return res;
}
FileName AndroidGdbServerKitInformation::autoDetect(Kit *kit)
{
    ToolChain *tc = ToolChainKitInformation::toolChain(kit);
    if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_ID)
        return FileName();
    AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc);
    return atc->suggestedGdbServer();
}
Beispiel #3
0
bool ToolChain::operator == (const ToolChain &tc) const
{
    if (this == &tc)
        return true;

    // We ignore displayname
    return typeId() == tc.typeId() && isAutoDetected() == tc.isAutoDetected();
}
bool AndroidGdbServerKitInformation::isAndroidKit(const Kit *kit)
{
    QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(kit);
    ToolChain *tc = ToolChainKitInformation::toolChain(kit);
    if (qt && tc)
        return qt->type() == QLatin1String(Constants::ANDROIDQT)
                && tc->typeId() == Constants::ANDROID_TOOLCHAIN_ID;
    return false;

}
Beispiel #5
0
static ToolChain *findOrCreateToolChain(const QList<ToolChain *> &alreadyKnown,
                                        const QString &name, const Abi &abi,
                                        const QString &varsBat, const QString &varsBatArg,
                                        ToolChain::Detection d = ToolChain::ManualDetection)
{
    ToolChain *tc = Utils::findOrDefault(alreadyKnown,
                                         [&varsBat, &varsBatArg](ToolChain *tc) -> bool {
                                              if (tc->typeId() != Constants::MSVC_TOOLCHAIN_TYPEID)
                                                  return false;
                                              auto mtc = static_cast<MsvcToolChain *>(tc);
                                              return mtc->varsBat() == varsBat
                                                      && mtc->varsBatArg() == varsBatArg;
                                         });
    if (!tc)
        tc = new MsvcToolChain(name, abi, varsBat, varsBatArg, d);
    return tc;
}
QVariant CMakeGeneratorKitInformation::defaultValue(const Kit *k) const
{
    CMakeTool *tool = CMakeKitInformation::cmakeTool(k);
    if (!tool)
        return QString();
    QStringList known = tool->supportedGenerators();
    auto it = std::find_if(known.constBegin(), known.constEnd(),
                           [](const QString &s) { return s == QLatin1String("CodeBlocks - Ninja"); });
    if (it != known.constEnd()) {
        Utils::Environment env = Utils::Environment::systemEnvironment();
        k->addToEnvironment(env);
        const Utils::FileName ninjaExec = env.searchInPath(QLatin1String("ninja"));
        if (ninjaExec.isEmpty())
            it = known.constEnd(); // Ignore ninja generator without ninja exectuable
    }
    if (Utils::HostOsInfo::isWindowsHost()) {
        // *sigh* Windows with its zoo of incompatible stuff again...
        ToolChain *tc = ToolChainKitInformation::toolChain(k, ToolChain::Language::Cxx);
        if (tc && tc->typeId() == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID) {
            if (it == known.constEnd())
                it = std::find_if(known.constBegin(), known.constEnd(),
                                  [](const QString &s) { return s == QLatin1String("CodeBlocks - MinGW Makefiles"); });
        } else {
            if (it == known.constEnd())
                it = std::find_if(known.constBegin(), known.constEnd(),
                                  [](const QString &s) { return s == QLatin1String("CodeBlocks - NMake Makefiles"); });
        }

    } else {
        // Unix-oid OSes:
        if (it == known.constEnd())
            it = std::find_if(known.constBegin(), known.constEnd(),
                              [](const QString &s) { return s == QLatin1String("CodeBlocks - Unix Makefiles"); });
    }
    if (it == known.constEnd())
        it = known.constBegin(); // Fallback to the first generator...
    if (it != known.constEnd())
        return *it;
    return QString();
}