diff options
Diffstat (limited to 'qmake/generators/makefile.h')
-rw-r--r-- | qmake/generators/makefile.h | 65 |
1 files changed, 27 insertions, 38 deletions
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 131da4943f..6ab4ad505d 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the qmake application of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 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. -** -** 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. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #ifndef MAKEFILE_H #define MAKEFILE_H @@ -36,6 +11,7 @@ #include <qlist.h> #include <qhash.h> #include <qfileinfo.h> +#include <functional> QT_BEGIN_NAMESPACE @@ -120,6 +96,7 @@ protected: void writeSubTargetCall(QTextStream &t, const QString &in_directory, const QString &in, const QString &out_directory, const QString &out, const QString &out_directory_cdin, const QString &makefilein); + virtual void suppressBuiltinRules(QTextStream &t) const; virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin, const QString &makeFileIn); virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags); @@ -159,6 +136,7 @@ protected: void verifyCompilers(); virtual void init(); void initOutPaths(); + virtual bool inhibitMakeDirOutPath(const ProKey &path) const; struct Compiler { QString variable_in; @@ -167,7 +145,8 @@ protected: CompilerBuiltin = 0x01, CompilerNoCheckDeps = 0x02, CompilerRemoveNoExist = 0x04, - CompilerAddInputsAsMakefileDeps = 0x08 + CompilerWarnNoExist = 0x08, + CompilerAddInputsAsMakefileDeps = 0x10 }; uint flags, type; }; @@ -200,10 +179,7 @@ protected: virtual bool doDepends() const { return Option::mkfile::do_deps; } void filterIncludedFiles(const char *); - void processSources() { - filterIncludedFiles("SOURCES"); - filterIncludedFiles("GENERATED_SOURCES"); - } + void processSources(); //for installs virtual QString defaultInstall(const QString &); @@ -257,14 +233,27 @@ public: protected: QString fileFixify(const QString &file, FileFixifyTypes fix = FileFixifyDefault, bool canon = true) const; QStringList fileFixify(const QStringList &files, FileFixifyTypes fix = FileFixifyDefault, bool canon = true) const; - - QString installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst); + QString createSedArgs(const ProKey &replace_rule, const QString &file_type = QString()) const; + QString installMetaFile(const ProKey &replace_rule, const QString &src, + const QString &dst) const; virtual bool processPrlFileBase(QString &origFile, QStringView origName, QStringView fixedBase, int slashOff); bool processPrlFileCore(QString &origFile, QStringView origName, const QString &fixedFile); - void createResponseFile(const QString &fileName, const ProStringList &objList); + QString createResponseFile(const QString &baseName, + const ProStringList &objList, + const QString &prefix = QString()) const; + + struct LinkerResponseFileInfo + { + QString filePath; + bool onlyObjects; + + bool isValid() const { return !filePath.isEmpty(); } + }; + + LinkerResponseFileInfo maybeCreateLinkerResponseFile() const; public: QMakeProject *projectFile() const; @@ -284,10 +273,10 @@ public: virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; } virtual bool openOutput(QFile &, const QString &build) const; bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); } - QString shellQuote(const QString &str); + QString shellQuote(const QString &str) const; virtual ProKey fullTargetVariable() const; }; -Q_DECLARE_TYPEINFO(MakefileGenerator::Compiler, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO(MakefileGenerator::Compiler, Q_RELOCATABLE_TYPE); Q_DECLARE_OPERATORS_FOR_FLAGS(MakefileGenerator::FileFixifyTypes) inline void MakefileGenerator::setNoIO(bool o) @@ -307,7 +296,7 @@ inline bool MakefileGenerator::findLibraries(bool, bool) struct ReplaceExtraCompilerCacheKey { - mutable uint hash; + mutable size_t hash; QString var, in, out, pwd; MakefileGenerator::ReplaceFor forShell; ReplaceExtraCompilerCacheKey(const QString &v, const QStringList &i, const QStringList &o, MakefileGenerator::ReplaceFor s); |