Changeset View
Changeset View
Standalone View
Standalone View
projectmanagers/qmake/qmakeprojectfile.cpp
Show First 20 Lines • Show All 281 Lines • ▼ Show 20 Line(s) | 265 | foreach (const auto& var, variablesToCheck) { | |||
---|---|---|---|---|---|
282 | } | 282 | } | ||
283 | } | 283 | } | ||
284 | #ifdef Q_OS_OSX | 284 | #ifdef Q_OS_OSX | ||
285 | fwDirs << m_qtLibDir; | 285 | fwDirs << m_qtLibDir; | ||
286 | #endif | 286 | #endif | ||
287 | return fwDirs; | 287 | return fwDirs; | ||
288 | } | 288 | } | ||
289 | 289 | | |||
290 | QStringList QMakeProjectFile::extraArguments() const | ||||
291 | { | ||||
292 | const auto variablesToCheck = {QStringLiteral("QMAKE_CFLAGS"), | ||||
mwolff: imo it should be either CFLAGS or CXXFLAGS, not a combination of the two which could lead… | |||||
Meh, we're passing it to clang, in fact it's what clang will use to figure out if to use c++ or c parsing. I'll change to just use CXXFLAGS and it will already be better than the status quo. apol: Meh, we're passing it to clang, in fact it's what clang will use to figure out if to use c++ or… | |||||
You could use initializer_list here to obsolete the memory allocation for the vector: const auto variablesToCheck = {...}; const auto prefixes = {...}; mwolff: You could use initializer_list here to obsolete the memory allocation for the vector… | |||||
293 | QStringLiteral("QMAKE_CXXFLAGS"), | ||||
mwolff: isn't `-isystem` still missing? | |||||
I'm not sure it's a problem. Furthermore qmake isn't passing -isystem anywhere. I'd say we can try it like this and if it's a problem we include it. apol: I'm not sure it's a problem. Furthermore qmake isn't passing `-isystem` anywhere. I'd say we… | |||||
294 | QStringLiteral("QMAKE_LFLAGS")}; | ||||
mwolff: why LFLAGS, that sounds unnecessary for our purposes | |||||
295 | const QVector<QLatin1String> prefixes = { QLatin1String("-F"), QLatin1String("-iframework"), QLatin1String("-I") }; | ||||
mwolff: `-isystem` too? And is it really "-F" or did you mean "-D"? | |||||
apol: Yeah, actually what I meant to do here was to filter these out. | |||||
296 | QStringList args; | ||||
297 | foreach (const auto& var, variablesToCheck) { | ||||
298 | foreach (const auto& arg, variableValues(var)) { | ||||
299 | for (const auto& prefix: prefixes) { | ||||
300 | if (arg.startsWith(prefix)) { | ||||
this should be negated, no? You want to find everything that is _not_ an include path, no? Also, defines should be skipped too, thus -D above, not -F? mwolff: this should be negated, no? You want to find everything that is _not_ an include path, no? Also… | |||||
brauch: It should be, but this doesn't negate it :D | |||||
301 | args << arg; | ||||
302 | } | ||||
303 | } | ||||
304 | } | ||||
305 | } | ||||
306 | return args; | ||||
307 | } | ||||
308 | | ||||
290 | QStringList QMakeProjectFile::files() const | 309 | QStringList QMakeProjectFile::files() const | ||
291 | { | 310 | { | ||
292 | ifDebug(qCDebug(KDEV_QMAKE) << "Fetching files";) | 311 | ifDebug(qCDebug(KDEV_QMAKE) << "Fetching files";) | ||
293 | 312 | | |||
294 | QStringList list; | 313 | QStringList list; | ||
295 | foreach (const QString& variable, QMakeProjectFile::FileVariables) { | 314 | foreach (const QString& variable, QMakeProjectFile::FileVariables) { | ||
296 | foreach (const QString& value, variableValues(variable)) { | 315 | foreach (const QString& value, variableValues(variable)) { | ||
297 | list += resolveFileName(value); | 316 | list += resolveFileName(value); | ||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |
imo it should be either CFLAGS or CXXFLAGS, not a combination of the two which could lead really funky combinations that would break in magic ways... Could you maybe check at the callee site whether we are interested in C or C++ flags?