Changeset View
Changeset View
Standalone View
Standalone View
plugins/custommake/makefileresolver/makefileresolver.cpp
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Line(s) | 89 | public: | |||
---|---|---|---|---|---|
90 | explicit SourcePathInformation(const QString& path) | 90 | explicit SourcePathInformation(const QString& path) | ||
91 | : m_path(path) | 91 | : m_path(path) | ||
92 | { | 92 | { | ||
93 | } | 93 | } | ||
94 | 94 | | |||
95 | QString createCommand(const QString& absoluteFile, const QString& workingDirectory, const QString& makeParameters) const | 95 | QString createCommand(const QString& absoluteFile, const QString& workingDirectory, const QString& makeParameters) const | ||
96 | { | 96 | { | ||
97 | QString relativeFile = Path(workingDirectory).relativePath(Path(absoluteFile)); | 97 | QString relativeFile = Path(workingDirectory).relativePath(Path(absoluteFile)); | ||
98 | return "make -k --no-print-directory -W \'" + absoluteFile + "\' -W \'" + relativeFile + "\' -n " + makeParameters; | 98 | #ifndef Q_OS_FREEBSD | ||
99 | // GNU make implicitly enables "-w" for sub-makes, we don't want that | ||||
kossebau: Please add a comment saying why this is needed, e.g.
```
// GNU make implicitly enables "-w"… | |||||
100 | QLatin1String noPrintDirFlag = QLatin1String(" --no-print-directory"); | ||||
The reassignment looks strange, IMHO would be better to do #ifdef Q_OS_FREEBSD // on FreeBSD gmake is needed because foobar const QLatin1String makeExe("gmake"); #else const QLatin1String makeExec("make"); #endif kossebau: The reassignment looks strange, IMHO would be better to do
```
#ifdef Q_OS_FREEBSD
// on… | |||||
101 | #else | ||||
102 | QLatin1String noPrintDirFlag; | ||||
103 | #endif | ||||
104 | return "make -k" + noPrintDirFlag + " -W \'" + absoluteFile + "\' -W \'" + relativeFile + "\' -n " + makeParameters; | ||||
Type of make could be QLatin1String as well, given below in the concatenation QStringBuilder happily deals with QLatin1Strings, saves us one conversion/malloc at runtime. kossebau: Type of `make` could be QLatin1String as well, given below in the concatenation QStringBuilder… | |||||
99 | } | 105 | } | ||
100 | 106 | | |||
101 | bool hasMakefile() const | 107 | bool hasMakefile() const | ||
102 | { | 108 | { | ||
103 | QFileInfo makeFile(m_path, QStringLiteral("Makefile")); | 109 | QFileInfo makeFile(m_path, QStringLiteral("Makefile")); | ||
104 | return makeFile.exists(); | 110 | return makeFile.exists(); | ||
105 | } | 111 | } | ||
106 | 112 | | |||
▲ Show 20 Lines • Show All 528 Lines • Show Last 20 Lines |
Please add a comment saying why this is needed, e.g.