QStringList QmakeBuildConfiguration::deduceArgumnetsForTargetAbi(const ProjectExplorer::Abi &targetAbi, const BaseQtVersion *version)
{
    QStringList arguments;
    if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
            && (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
        if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
            if (targetAbi.wordWidth() == 32)
                arguments << QLatin1String("CONFIG+=x86");
            else if (targetAbi.wordWidth() == 64)
                arguments << QLatin1String("CONFIG+=x86_64");

            const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios";
            if (version && version->type() == QLatin1String(IOSQT)) // ugly, we can't distinguish between ios and mac toolchains
                arguments << QLatin1String("CONFIG+=iphonesimulator");
        } else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
            if (targetAbi.wordWidth() == 32)
                arguments << QLatin1String("CONFIG+=ppc");
            else if (targetAbi.wordWidth() == 64)
                arguments << QLatin1String("CONFIG+=ppc64");
        } else if (targetAbi.architecture() == ProjectExplorer::Abi::ArmArchitecture) {
            arguments << QLatin1String("CONFIG+=iphoneos");
        }
    }
    return arguments;
}
Пример #2
0
///
/// moreArguments,
/// -unix for Maemo
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::deducedArguments()
{
    QStringList arguments;
    ProjectExplorer::ToolChain *tc
            = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
    ProjectExplorer::Abi targetAbi;
    if (tc)
        targetAbi = tc->targetAbi();
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
    if ((targetAbi.osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor
               || targetAbi.osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor))
        arguments << QLatin1String("-unix");
#endif

    // explicitly add architecture to CONFIG
    if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
            && (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
        if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
            if (targetAbi.wordWidth() == 32)
                arguments << QLatin1String("CONFIG+=x86");
            else if (targetAbi.wordWidth() == 64)
                arguments << QLatin1String("CONFIG+=x86_64");
        } else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
            if (targetAbi.wordWidth() == 32)
                arguments << QLatin1String("CONFIG+=ppc");
            else if (targetAbi.wordWidth() == 64)
                arguments << QLatin1String("CONFIG+=ppc64");
        }
    }

    QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
    if (linkQmlDebuggingLibrary() && version) {
        if (!version->needsQmlDebuggingLibrary()) {
            // This Qt version has the QML debugging services built in, however
            // they still need to be enabled at compile time
            arguments << (version->qtVersion().majorVersion >= 5 ?
                          QLatin1String(Constants::QMAKEVAR_DECLARATIVE_DEBUG5) :
                          QLatin1String(Constants::QMAKEVAR_DECLARATIVE_DEBUG4));
        } else {
            const QString qmlDebuggingHelperLibrary = version->qmlDebuggingHelperLibrary(true);
            if (!qmlDebuggingHelperLibrary.isEmpty()) {
                // Do not turn debugger path into native path separators: Qmake does not like that!
                const QString debuggingHelperPath
                        = QFileInfo(qmlDebuggingHelperLibrary).dir().path();

                arguments << QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)
                             + QLatin1Char('=') + debuggingHelperPath;
            }
        }
    }


    return arguments;
}
Пример #3
0
///
/// moreArguments,
/// iphoneos/iphonesimulator for ios
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::deducedArguments()
{
    QStringList arguments;
    ProjectExplorer::ToolChain *tc
            = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
    ProjectExplorer::Abi targetAbi;
    if (tc)
        targetAbi = tc->targetAbi();

    // explicitly add architecture to CONFIG
    if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
            && (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
        if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
            if (targetAbi.wordWidth() == 32)
                arguments << QLatin1String("CONFIG+=x86");
            else if (targetAbi.wordWidth() == 64)
                arguments << QLatin1String("CONFIG+=x86_64");

            const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?)
            QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
            if (version && version->type() == QLatin1String(IOSQT))
                arguments << QLatin1String("CONFIG+=iphonesimulator");
        } else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
            if (targetAbi.wordWidth() == 32)
                arguments << QLatin1String("CONFIG+=ppc");
            else if (targetAbi.wordWidth() == 64)
                arguments << QLatin1String("CONFIG+=ppc64");
        } else if (targetAbi.architecture() == ProjectExplorer::Abi::ArmArchitecture) {
            arguments << QLatin1String("CONFIG+=iphoneos");
        }
    }

    QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
    if (linkQmlDebuggingLibrary() && version) {
        arguments << QLatin1String(Constants::QMAKEVAR_QUICK1_DEBUG);
        if (version->qtVersion().majorVersion >= 5)
            arguments << QLatin1String(Constants::QMAKEVAR_QUICK2_DEBUG);
    }


    return arguments;
}
Пример #4
0
bool MemoryAgent::isBigEndian(const ProjectExplorer::Abi &a)
{
    switch (a.architecture()) {
    case ProjectExplorer::Abi::UnknownArchitecture:
    case ProjectExplorer::Abi::X86Architecture:
    case ProjectExplorer::Abi::ItaniumArchitecture: // Configureable
    case ProjectExplorer::Abi::ArmArchitecture:     // Configureable
    case ProjectExplorer::Abi::ShArchitecture:     // Configureable
        break;
    case ProjectExplorer::Abi::MipsArchitecture:     // Configureable
    case ProjectExplorer::Abi::PowerPCArchitecture: // Configureable
        return true;
    }
    return false;
}
void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
{
    QStringList usedProfileNames = profileNames();
    const QString name = ProjectExplorer::Project::makeUnique(
                QString::fromLatin1("qtc_") + k->fileSystemFriendlyName(), usedProfileNames);
    setProfileForKit(name, k);

    QVariantMap data;
    QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(k);
    if (qt) {
        data.insert(QLatin1String(QTCORE_BINPATH), qt->binPath().toUserOutput());
        QStringList builds;
        if (qt->hasDebugBuild())
            builds << QLatin1String("debug");
        if (qt->hasReleaseBuild())
            builds << QLatin1String("release");
        data.insert(QLatin1String(QTCORE_BUILDVARIANT), builds);
        data.insert(QLatin1String(QTCORE_DOCPATH), qt->docsPath().toUserOutput());
        data.insert(QLatin1String(QTCORE_INCPATH), qt->headerPath().toUserOutput());
        data.insert(QLatin1String(QTCORE_LIBPATH), qt->libraryPath().toUserOutput());
        Utils::FileName mkspecPath = qt->mkspecsPath();
        mkspecPath.appendPath(qt->mkspec().toString());
        data.insert(QLatin1String(QTCORE_MKSPEC), mkspecPath.toUserOutput());
        data.insert(QLatin1String(QTCORE_NAMESPACE), qt->qtNamespace());
        data.insert(QLatin1String(QTCORE_LIBINFIX), qt->qtLibInfix());
        data.insert(QLatin1String(QTCORE_VERSION), qt->qtVersionString());
        if (qt->isFrameworkBuild())
            data.insert(QLatin1String(QTCORE_FRAMEWORKBUILD), true);
    }

    if (ProjectExplorer::SysRootKitInformation::hasSysRoot(k))
        data.insert(QLatin1String(QBS_SYSROOT), ProjectExplorer::SysRootKitInformation::sysRoot(k).toUserOutput());

    ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
    if (tc) {
        // FIXME/CLARIFY: How to pass the sysroot?
        ProjectExplorer::Abi targetAbi = tc->targetAbi();
        QString architecture = ProjectExplorer::Abi::toString(targetAbi.architecture());
        if (targetAbi.wordWidth() == 64)
            architecture.append(QLatin1String("_64"));
        data.insert(QLatin1String(QBS_ARCHITECTURE), architecture);

        if (targetAbi.endianness() == ProjectExplorer::Abi::BigEndian)
            data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("big"));
        else
            data.insert(QLatin1String(QBS_ENDIANNESS), QLatin1String("little"));

        if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) {
            data.insert(QLatin1String(QBS_TARGETOS), QLatin1String("windows"));
            data.insert(QLatin1String(QBS_TOOLCHAIN),
                               targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor
                                   ? QStringList() << QLatin1String("mingw") << QLatin1String("gcc")
                                   : QStringList() << QLatin1String("msvc"));
        } else if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
            data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("osx")
                        << QLatin1String("darwin") << QLatin1String("unix"));
            if (tc->type() != QLatin1String("clang")) {
                data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc"));
            } else {
                data.insert(QLatin1String(QBS_TOOLCHAIN),
                            QStringList() << QLatin1String("clang")
                            << QLatin1String("llvm")
                            << QLatin1String("gcc"));
            }
        } else if (targetAbi.os() == ProjectExplorer::Abi::LinuxOS) {
            data.insert(QLatin1String(QBS_TARGETOS), QStringList() << QLatin1String("linux")
                        << QLatin1String("unix"));
            if (tc->type() != QLatin1String("clang")) {
                data.insert(QLatin1String(QBS_TOOLCHAIN), QLatin1String("gcc"));
            } else {
                data.insert(QLatin1String(QBS_TOOLCHAIN),
                            QStringList() << QLatin1String("clang")
                            << QLatin1String("llvm")
                            << QLatin1String("gcc"));
            }
        }
        Utils::FileName cxx = tc->compilerCommand();
        data.insert(QLatin1String(CPP_TOOLCHAINPATH), cxx.toFileInfo().absolutePath());
        data.insert(QLatin1String(CPP_COMPILERNAME), cxx.toFileInfo().fileName());
    }
    addProfile(name, data);
}
ProjectExplorer::Abi QmlProjectRunConfiguration::abi() const
{
    ProjectExplorer::Abi hostAbi = ProjectExplorer::Abi::hostAbi();
    return ProjectExplorer::Abi(hostAbi.architecture(), hostAbi.os(), hostAbi.osFlavor(),
                                ProjectExplorer::Abi::RuntimeQmlFormat, hostAbi.wordWidth());
}