2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 BogDan Vatra <bog_dan_ro@yahoo.com>
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2012-04-18 20:30:57 +03:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2012-04-18 20:30:57 +03:00
|
|
|
|
|
|
|
|
#include <projectexplorer/gcctoolchain.h>
|
|
|
|
|
#include <projectexplorer/toolchainconfigwidget.h>
|
|
|
|
|
|
|
|
|
|
namespace Android {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class AndroidToolChain : public ProjectExplorer::GccToolChain
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-07-07 13:39:40 +02:00
|
|
|
~AndroidToolChain() override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2015-07-07 13:39:40 +02:00
|
|
|
QString typeDisplayName() const override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2015-07-07 13:39:40 +02:00
|
|
|
bool isValid() const override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2015-07-07 13:39:40 +02:00
|
|
|
void addToEnvironment(Utils::Environment &env) const override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2015-07-07 13:39:40 +02:00
|
|
|
bool operator ==(const ProjectExplorer::ToolChain &) const override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2018-07-11 08:25:07 +02:00
|
|
|
std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() override;
|
2017-11-06 16:00:25 +01:00
|
|
|
Utils::FileName suggestedDebugger() const override;
|
2013-01-25 16:49:22 +01:00
|
|
|
Utils::FileName suggestedGdbServer() const;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2015-07-07 13:39:40 +02:00
|
|
|
QVariantMap toMap() const override;
|
|
|
|
|
bool fromMap(const QVariantMap &data) override;
|
2015-11-03 14:01:25 +01:00
|
|
|
Utils::FileNameList suggestedMkspecList() const override;
|
2015-07-07 13:39:40 +02:00
|
|
|
QString makeCommand(const Utils::Environment &environment) const override;
|
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);
|
|
|
|
|
|
2018-09-17 11:29:32 +02:00
|
|
|
BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const override;
|
2017-11-06 16:00:25 +01:00
|
|
|
|
2012-04-18 20:30:57 +03:00
|
|
|
protected:
|
2016-03-04 15:33:16 +01:00
|
|
|
DetectedAbisResult detectSupportedAbis() const override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
|
|
|
|
private:
|
2016-07-12 12:20:06 +02:00
|
|
|
explicit AndroidToolChain(const ProjectExplorer::Abi &abi, const QString &ndkToolChainVersion,
|
2016-12-16 00:43:14 +01:00
|
|
|
Core::Id l, 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:
|
2015-07-07 13:39:40 +02:00
|
|
|
void applyImpl() override {}
|
|
|
|
|
void discardImpl() override {}
|
|
|
|
|
bool isDirtyImpl() const override { return false; }
|
|
|
|
|
void makeReadOnlyImpl() override {}
|
2012-04-18 20:30:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AndroidToolChainFactory : public ProjectExplorer::ToolChainFactory
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
AndroidToolChainFactory();
|
2016-12-16 00:43:14 +01:00
|
|
|
QSet<Core::Id> supportedLanguages() const override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2015-07-19 10:59:06 +03:00
|
|
|
QList<ProjectExplorer::ToolChain *> autoDetect(const QList<ProjectExplorer::ToolChain *> &alreadyKnown) override;
|
2015-07-07 13:39:40 +02:00
|
|
|
bool canRestore(const QVariantMap &data) override;
|
|
|
|
|
ProjectExplorer::ToolChain *restore(const QVariantMap &data) override;
|
2012-04-18 20:30:57 +03:00
|
|
|
|
2013-02-14 15:51:59 +01:00
|
|
|
class AndroidToolChainInformation
|
|
|
|
|
{
|
|
|
|
|
public:
|
2016-12-16 00:43:14 +01:00
|
|
|
Core::Id language;
|
2013-02-14 15:51:59 +01:00
|
|
|
Utils::FileName compilerCommand;
|
2014-11-18 18:37:05 +01:00
|
|
|
ProjectExplorer::Abi abi;
|
2013-02-14 15:51:59 +01:00
|
|
|
QString version;
|
|
|
|
|
};
|
|
|
|
|
|
2015-10-15 16:01:40 +02:00
|
|
|
static QList<ProjectExplorer::ToolChain *>
|
|
|
|
|
autodetectToolChainsForNdk(const Utils::FileName &ndkPath,
|
|
|
|
|
const QList<ProjectExplorer::ToolChain *> &alreadyKnown);
|
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);
|
2016-10-24 15:53:37 +02:00
|
|
|
static bool versionCompareLess(QList<AndroidToolChain *> atc,
|
|
|
|
|
QList<AndroidToolChain *> btc);
|
2014-11-18 18:37:05 +01:00
|
|
|
static QList<int> newestToolChainVersionForArch(const ProjectExplorer::Abi &abi);
|
2013-08-28 13:34:24 +02:00
|
|
|
private:
|
2014-11-18 18:37:05 +01:00
|
|
|
static QHash<ProjectExplorer::Abi, QList<int> > m_newestVersionForAbi;
|
2013-08-28 13:34:24 +02:00
|
|
|
static Utils::FileName m_ndkLocation;
|
2012-04-18 20:30:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Android
|