Skip to content

Commit

Permalink
fix: [project] Incorrect parameters when executing clean
Browse files Browse the repository at this point in the history
Log: as title
  • Loading branch information
LiHua000 authored and deepin-mozart committed Jul 12, 2024
1 parent c873ea7 commit fb87671
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ BuildCommandInfo CMakeBuilderGenerator::getMenuCommand(const BuildMenuType build
if (buildMenuType == Build) {
info.arguments = projectInfo.buildCustomArgs();
} else if (buildMenuType == Clean) {
// TODO(Mozart):cleanCustomArgs not fill correct, modify it later.
// info.arguments = projectInfo.cleanCustomArgs();
info.arguments.clear();
info.arguments << "--build";
info.arguments << ".";
info.arguments << "--target";
info.arguments << "clean";
info.arguments = projectInfo.cleanCustomArgs();
}

info.program = projectInfo.buildProgram();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,12 @@ void StepsPane::setValues(const config::StepItem &item)
d->toolArguments->setText(item.buildArguments.join(" "));

QMap<QString, bool> data;
foreach (auto targetName, item.allTargetNames) {
data.insert(targetName, targetName == item.activeTargetName ? true : false);
if (item.type == config::StepType::Build) {
foreach (auto targetName, item.allTargetNames) {
data.insert(targetName, targetName == item.activeTargetName ? true : false);
}
} else if (item.type == config::StepType::Clean) {
data.insert("clean", true);
}

d->model->setData(data);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/cxx/cmake/project/properties/configutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ bool ConfigUtil::updateProjectInfo(dpfservice::ProjectInfo &info, const ProjectC
} else if (iterStep->type == StepType::Clean) {
QString cleanTarget = iterStep->activeTargetName;
if (cleanTarget.isEmpty()) {
cleanTarget = "all";
cleanTarget = "clean";
}
TargetsManager::instance()->updateActivedCleanTarget(cleanTarget);
arguments << cleanTarget;
Expand Down

0 comments on commit fb87671

Please sign in to comment.