2012-04-18 20:30:57 +03:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (c) 2014 BogDan Vatra <bog_dan_ro@yahoo.com>
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
2014-10-01 13:21:18 +02:00
|
|
|
** conditions see http://www.qt.io/licensing. For further information
|
|
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2012-04-18 20:30:57 +03:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-04-18 20:30:57 +03:00
|
|
|
|
|
|
|
|
#ifndef ANDROIDTOOLCHAIN_H
|
|
|
|
|
#define ANDROIDTOOLCHAIN_H
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/gcctoolchain.h>
|
|
|
|
|
#include <projectexplorer/toolchainconfigwidget.h>
|
|
|
|
|
|
|
|
|
|
namespace Android {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class AndroidToolChain : public ProjectExplorer::GccToolChain
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
~AndroidToolChain();
|
|
|
|
|
|
|
|
|
|
QString type() const;
|
|
|
|
|
QString typeDisplayName() const;
|
|
|
|
|
|
|
|
|
|
bool isValid() const;
|
|
|
|
|
|
|
|
|
|
void addToEnvironment(Utils::Environment &env) const;
|
|
|
|
|
|
|
|
|
|
bool operator ==(const ProjectExplorer::ToolChain &) const;
|
|
|
|
|
|
|
|
|
|
ProjectExplorer::ToolChainConfigWidget *configurationWidget();
|
2013-01-25 16:49:22 +01:00
|
|
|
virtual Utils::FileName suggestedDebugger() const;
|
|
|
|
|
Utils::FileName suggestedGdbServer() const;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
|
|
|
|
QVariantMap toMap() const;
|
|
|
|
|
bool fromMap(const QVariantMap &data);
|
|
|
|
|
QList<Utils::FileName> suggestedMkspecList() const;
|
2012-12-07 19:52:56 +02:00
|
|
|
QString makeCommand(const Utils::Environment &environment) const;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2013-10-11 11:29:06 +02:00
|
|
|
QString ndkToolChainVersion() const;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-10-11 11:29:06 +02:00
|
|
|
bool isSecondaryToolChain() const;
|
2013-08-28 13:34:24 +02:00
|
|
|
void setSecondaryToolChain(bool b);
|
|
|
|
|
|
2012-04-18 20:30:57 +03:00
|
|
|
protected:
|
2012-08-09 01:56:51 +02:00
|
|
|
QList<ProjectExplorer::Abi> detectSupportedAbis() const;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
|
|
|
|
private:
|
2013-09-03 10:58:59 +02:00
|
|
|
explicit AndroidToolChain(ProjectExplorer::Abi::Architecture arch, const QString &ndkToolChainVersion, Detection d);
|
2013-01-25 16:49:22 +01:00
|
|
|
AndroidToolChain();
|
2012-04-18 20:30:57 +03:00
|
|
|
AndroidToolChain(const AndroidToolChain &);
|
|
|
|
|
|
2013-01-25 16:49:22 +01:00
|
|
|
QString m_ndkToolChainVersion;
|
2013-08-28 13:34:24 +02:00
|
|
|
bool m_secondaryToolChain;
|
|
|
|
|
|
2012-04-18 20:30:57 +03:00
|
|
|
friend class AndroidToolChainFactory;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AndroidToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
AndroidToolChainConfigWidget(AndroidToolChain *);
|
|
|
|
|
|
2012-08-16 15:59:10 +02:00
|
|
|
private:
|
|
|
|
|
void applyImpl() {}
|
|
|
|
|
void discardImpl() {}
|
|
|
|
|
bool isDirtyImpl() const { return false; }
|
|
|
|
|
void makeReadOnlyImpl() {}
|
2012-04-18 20:30:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AndroidToolChainFactory : public ProjectExplorer::ToolChainFactory
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
AndroidToolChainFactory();
|
|
|
|
|
|
|
|
|
|
QList<ProjectExplorer::ToolChain *> autoDetect();
|
|
|
|
|
bool canRestore(const QVariantMap &data);
|
|
|
|
|
ProjectExplorer::ToolChain *restore(const QVariantMap &data);
|
|
|
|
|
|
2013-02-14 15:51:59 +01:00
|
|
|
class AndroidToolChainInformation
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Utils::FileName compilerCommand;
|
|
|
|
|
ProjectExplorer::Abi::Architecture architecture;
|
|
|
|
|
QString version;
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-25 16:49:22 +01:00
|
|
|
static QList<ProjectExplorer::ToolChain *> createToolChainsForNdk(const Utils::FileName &ndkPath);
|
2013-02-14 15:51:59 +01:00
|
|
|
static QList<AndroidToolChainInformation> toolchainPathsForNdk(const Utils::FileName &ndkPath);
|
2013-08-28 13:34:24 +02:00
|
|
|
|
|
|
|
|
static QList<int> versionNumberFromString(const QString &version);
|
|
|
|
|
static bool versionCompareLess(const QList<int> &a, const QList<int> &b);
|
|
|
|
|
static bool versionCompareLess(AndroidToolChain *atc, AndroidToolChain *btc);
|
|
|
|
|
static QList<int> newestToolChainVersionForArch(ProjectExplorer::Abi::Architecture arch);
|
|
|
|
|
private:
|
|
|
|
|
static QMap<ProjectExplorer::Abi::Architecture, QList<int> > m_newestVersionForArch;
|
|
|
|
|
static Utils::FileName m_ndkLocation;
|
2012-04-18 20:30:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Android
|
|
|
|
|
|
|
|
|
|
#endif // ANDROIDTOOLCHAIN_H
|