| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information ([email protected])
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the qmake application of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** package.
|
|---|
| 27 | **
|
|---|
| 28 | ** GNU General Public License Usage
|
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ** packaging of this file. Please review the following information to
|
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | **
|
|---|
| 36 | ** If you are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department at [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #ifndef MSVC_DSP_H
|
|---|
| 43 | #define MSVC_DSP_H
|
|---|
| 44 |
|
|---|
| 45 | #include "winmakefile.h"
|
|---|
| 46 |
|
|---|
| 47 | QT_BEGIN_NAMESPACE
|
|---|
| 48 |
|
|---|
| 49 | class FolderGroup;
|
|---|
| 50 |
|
|---|
| 51 | class DspMakefileGenerator : public Win32MakefileGenerator
|
|---|
| 52 | {
|
|---|
| 53 | bool init_flag;
|
|---|
| 54 | bool writeDspHeader(QTextStream &);
|
|---|
| 55 | bool writeDspParts(QTextStream &);
|
|---|
| 56 | bool writeFileGroup(QTextStream &t, const QStringList &listNames, const QString &group, const QString &filter);
|
|---|
| 57 | void writeSubFileGroup(QTextStream &t, FolderGroup *folder);
|
|---|
| 58 | bool writeBuildstepForFile(QTextStream &t, const QString &file, const QString &listName);
|
|---|
| 59 | static bool writeDspConfig(QTextStream &t, DspMakefileGenerator *config);
|
|---|
| 60 | static QString writeBuildstepForFileForConfig(const QString &file, const QString &listName, DspMakefileGenerator *config);
|
|---|
| 61 | QString configName(DspMakefileGenerator * config);
|
|---|
| 62 |
|
|---|
| 63 | bool writeMakefile(QTextStream &);
|
|---|
| 64 | bool writeProjectMakefile();
|
|---|
| 65 | void writeSubDirs(QTextStream &t);
|
|---|
| 66 | void init();
|
|---|
| 67 |
|
|---|
| 68 | public:
|
|---|
| 69 | DspMakefileGenerator();
|
|---|
| 70 | ~DspMakefileGenerator();
|
|---|
| 71 |
|
|---|
| 72 | bool openOutput(QFile &file, const QString &build) const;
|
|---|
| 73 | bool hasBuiltinCompiler(const QString &filename) const;
|
|---|
| 74 |
|
|---|
| 75 | protected:
|
|---|
| 76 | virtual bool doDepends() const { return false; } //never necesary
|
|---|
| 77 | virtual void processSources() { filterIncludedFiles("SOURCES"); filterIncludedFiles("GENERATED_SOURCES"); }
|
|---|
| 78 | virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &);
|
|---|
| 79 | inline QString replaceExtraCompilerVariables(const QString &val, const QString &in, const QString &out)
|
|---|
| 80 | { return MakefileGenerator::replaceExtraCompilerVariables(val, in, out); }
|
|---|
| 81 | virtual bool supportsMetaBuild() { return true; }
|
|---|
| 82 | virtual bool supportsMergedBuilds() { return true; }
|
|---|
| 83 | virtual bool mergeBuildProject(MakefileGenerator *other);
|
|---|
| 84 | virtual void processPrlVariable(const QString &, const QStringList &);
|
|---|
| 85 | virtual bool findLibraries();
|
|---|
| 86 |
|
|---|
| 87 | bool usePCH;
|
|---|
| 88 | QString precompH, namePCH,
|
|---|
| 89 | precompObj, precompPch;
|
|---|
| 90 |
|
|---|
| 91 | QString platform;
|
|---|
| 92 |
|
|---|
| 93 | struct BuildStep {
|
|---|
| 94 | BuildStep() {}
|
|---|
| 95 | BuildStep &operator<<(const BuildStep &other) {
|
|---|
| 96 | deps << other.deps;
|
|---|
| 97 | buildStep += other.buildStep;
|
|---|
| 98 | buildName += other.buildName;
|
|---|
| 99 | buildOutputs += other.buildOutputs;
|
|---|
| 100 | return *this;
|
|---|
| 101 | }
|
|---|
| 102 |
|
|---|
| 103 | QStringList deps;
|
|---|
| 104 | QString buildStep;
|
|---|
| 105 | QString buildName;
|
|---|
| 106 | QStringList buildOutputs;
|
|---|
| 107 | };
|
|---|
| 108 | QMap<QString, BuildStep> swappedBuildSteps;
|
|---|
| 109 |
|
|---|
| 110 | // Holds all configurations for glue (merged) project
|
|---|
| 111 | QList<DspMakefileGenerator*> mergedProjects;
|
|---|
| 112 | };
|
|---|
| 113 |
|
|---|
| 114 | inline DspMakefileGenerator::~DspMakefileGenerator()
|
|---|
| 115 | { }
|
|---|
| 116 |
|
|---|
| 117 | inline bool DspMakefileGenerator::findLibraries()
|
|---|
| 118 | { return Win32MakefileGenerator::findLibraries("MSVCDSP_LIBS"); }
|
|---|
| 119 |
|
|---|
| 120 | QT_END_NAMESPACE
|
|---|
| 121 |
|
|---|
| 122 | #endif // MSVC_DSP_H
|
|---|