Nim: Fix running when building with nimble

Change-Id: I62b2eebf408119a19f0e98958e3132c16c9c6aa5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Stenger
2020-08-31 14:28:10 +02:00
committed by hjk
parent 79010891e1
commit 158ac2d339
5 changed files with 23 additions and 26 deletions

View File

@@ -25,12 +25,10 @@
#include "nimblerunconfiguration.h"
#include "nimbuildsystem.h"
#include "nimblebuildsystem.h"
#include "nimconstants.h"
#include "nimbleproject.h"
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/localenvironmentaspect.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/runcontrol.h>
@@ -91,14 +89,7 @@ public:
NimbleTestConfiguration(ProjectExplorer::Target *target, Utils::Id id)
: RunConfiguration(target, id)
{
QString nimble;
auto bc = this->target()->activeBuildConfiguration();
auto nimbleBuildStep = bc->buildSteps()->firstStepWithId(Constants::C_NIMBLEBUILDSTEP_ID);
if (nimbleBuildStep && nimbleBuildStep->buildSystem()) {
nimble = static_cast<NimBuildSystem *>(nimbleBuildStep->buildSystem())->defaultNimble();
}
addAspect<ExecutableAspect>()->setExecutable(Utils::FilePath::fromString(nimble));
addAspect<ExecutableAspect>()->setExecutable(Nim::nimblePathFromKit(target->kit()));
addAspect<ArgumentsAspect>()->setArguments("test");
addAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(project()->projectDirectory());
addAspect<TerminalAspect>();