2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2015-03-04 17:14:28 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2015-03-04 17:14:28 +01:00
|
|
|
|
|
|
|
|
#include <qmakeprojectmanager/qmakestep.h>
|
2021-08-12 15:04:18 +02:00
|
|
|
#include <qtsupport/baseqtversion.h>
|
|
|
|
|
#include <utils/filepath.h>
|
2015-03-04 17:14:28 +01:00
|
|
|
|
|
|
|
|
namespace QmakeProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
struct QMakeAssignment
|
|
|
|
|
{
|
|
|
|
|
QString variable;
|
|
|
|
|
QString op;
|
|
|
|
|
QString value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class MakeFileParse
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-09-08 10:32:17 +02:00
|
|
|
enum class Mode { FilterKnownConfigValues, DoNotFilterKnownConfigValues };
|
2021-08-12 15:04:18 +02:00
|
|
|
MakeFileParse(const Utils::FilePath &makefile, Mode mode);
|
2015-03-04 17:14:28 +01:00
|
|
|
|
|
|
|
|
enum MakefileState { MakefileMissing, CouldNotParse, Okay };
|
|
|
|
|
|
|
|
|
|
MakefileState makeFileState() const;
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath qmakePath() const;
|
2021-08-12 15:04:18 +02:00
|
|
|
Utils::FilePath srcProFile() const;
|
2015-03-04 17:14:28 +01:00
|
|
|
QMakeStepConfig config() const;
|
|
|
|
|
|
|
|
|
|
QString unparsedArguments() const;
|
|
|
|
|
|
2022-01-21 16:06:36 +01:00
|
|
|
QtSupport::QtVersion::QmakeBuildConfigs
|
|
|
|
|
effectiveBuildConfig(QtSupport::QtVersion::QmakeBuildConfigs defaultBuildConfig) const;
|
2015-03-04 17:14:28 +01:00
|
|
|
|
|
|
|
|
static const QLoggingCategory &logging();
|
|
|
|
|
|
2016-10-07 15:11:10 +02:00
|
|
|
void parseCommandLine(const QString &command, const QString &project);
|
2016-10-07 13:03:00 +02:00
|
|
|
|
2015-03-04 17:14:28 +01:00
|
|
|
private:
|
2016-10-07 15:11:10 +02:00
|
|
|
void parseArgs(const QString &args, const QString &project,
|
|
|
|
|
QList<QMakeAssignment> *assignments, QList<QMakeAssignment> *afterAssignments);
|
2020-09-08 10:32:17 +02:00
|
|
|
QList<QMakeAssignment> parseAssignments(const QList<QMakeAssignment> &assignments);
|
2015-03-04 17:14:28 +01:00
|
|
|
|
|
|
|
|
class QmakeBuildConfig
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-06-18 15:14:06 +02:00
|
|
|
bool explicitDebug = false;
|
|
|
|
|
bool explicitRelease = false;
|
|
|
|
|
bool explicitBuildAll = false;
|
|
|
|
|
bool explicitNoBuildAll = false;
|
2015-03-04 17:14:28 +01:00
|
|
|
};
|
|
|
|
|
|
2020-09-08 10:32:17 +02:00
|
|
|
const Mode m_mode;
|
2015-03-04 17:14:28 +01:00
|
|
|
MakefileState m_state;
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath m_qmakePath;
|
2021-08-12 15:04:18 +02:00
|
|
|
Utils::FilePath m_srcProFile;
|
2015-03-04 17:14:28 +01:00
|
|
|
|
|
|
|
|
QmakeBuildConfig m_qmakeBuildConfig;
|
|
|
|
|
QMakeStepConfig m_config;
|
|
|
|
|
QString m_unparsedArguments;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmakeProjectManager
|