forked from qt-creator/qt-creator
CMakePM: Filter out empty key configuration items
There were cases when an empty "-D" CMake command line parameter would be genered, resulting in a failed CMake project configuration. Task-number: QTCREATORBUG-27256 Fixes: QTCREATORBUG-27237 Change-Id: Ic26c9dfe72db154cd76fdcc913eb7fe623b3123c Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -619,7 +619,7 @@ void CMakeBuildSettingsWidget::updateInitialCMakeArguments()
|
||||
*it = ci;
|
||||
if (ci.isUnset)
|
||||
initialList.erase(it);
|
||||
} else {
|
||||
} else if (!ci.key.isEmpty()) {
|
||||
initialList.push_back(ci);
|
||||
}
|
||||
}
|
||||
|
@@ -1122,8 +1122,12 @@ void CMakeConfigurationKitAspect::fromStringList(Kit *k, const QStringList &in)
|
||||
|
||||
QStringList CMakeConfigurationKitAspect::toArgumentsList(const Kit *k)
|
||||
{
|
||||
return Utils::transform(CMakeConfigurationKitAspect::configuration(k).toList(),
|
||||
[](const CMakeConfigItem &i) { return i.toArgument(nullptr); });
|
||||
QStringList current = Utils::transform(CMakeConfigurationKitAspect::configuration(k).toList(),
|
||||
[](const CMakeConfigItem &i) {
|
||||
return i.toArgument(nullptr);
|
||||
});
|
||||
current = Utils::filtered(current, [](const QString &s) { return s != "-D" || s != "-U"; });
|
||||
return current;
|
||||
}
|
||||
|
||||
CMakeConfig CMakeConfigurationKitAspect::defaultConfiguration(const Kit *k)
|
||||
|
Reference in New Issue
Block a user