From 3cd476e582171860f098021599077b60eb36d09f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 20 May 2022 14:11:52 +0200 Subject: [PATCH] CMakeBuildSystem: Remove some left-overs From removing the "first build in temporary directory" mechanics. The method that would previously switch the build directory from temporary to real now just ensures that the build directory exists and passes the input build directory through. Name it encordingly and remove the confusing return value. Remove condition that now was always true. Amends 0e613918b63219b950efb03a8ebeb70aaeb870d5 Change-Id: I8d4cff23b3fcba895bc7338e7277d44efb46e8e7 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Cristian Adam --- .../cmakeprojectmanager/cmakebuildsystem.cpp | 14 ++++++-------- src/plugins/cmakeprojectmanager/cmakebuildsystem.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index 3db61fe1211..0ce9e360e29 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -387,7 +387,7 @@ void CMakeBuildSystem::setParametersAndRequestParse(const BuildDirParameters &pa QTC_ASSERT(parameters.isValid(), return ); m_parameters = parameters; - m_parameters.buildDirectory = buildDirectory(parameters); + ensureBuildDirectory(parameters); updateReparseParameters(reparseParameters); m_reader.setParameters(m_parameters); @@ -455,15 +455,14 @@ bool CMakeBuildSystem::persistCMakeState() QTC_ASSERT(parameters.isValid(), return false); const bool hadBuildDirectory = parameters.buildDirectory.exists(); - parameters.buildDirectory = buildDirectory(parameters); + ensureBuildDirectory(parameters); int reparseFlags = REPARSE_DEFAULT; qCDebug(cmakeBuildSystemLog) << "Checking whether build system needs to be persisted:" << "buildDir:" << parameters.buildDirectory << "Has extraargs:" << !parameters.configurationChangesArguments.isEmpty(); - if (parameters.buildDirectory == parameters.buildDirectory - && mustApplyConfigurationChangesArguments(parameters)) { + if (mustApplyConfigurationChangesArguments(parameters)) { reparseFlags = REPARSE_FORCE_EXTRA_CONFIGURATION; qCDebug(cmakeBuildSystemLog) << " -> must run CMake with extra arguments."; } @@ -864,15 +863,13 @@ void CMakeBuildSystem::wireUpConnections() } } -FilePath CMakeBuildSystem::buildDirectory(const BuildDirParameters ¶meters) +void CMakeBuildSystem::ensureBuildDirectory(const BuildDirParameters ¶meters) { const FilePath bdir = parameters.buildDirectory; if (!buildConfiguration()->createBuildDirectory()) handleParsingFailed( tr("Failed to create build directory \"%1\".").arg(bdir.toUserOutput())); - - return bdir; } void CMakeBuildSystem::stopParsingAndClearState() @@ -917,7 +914,8 @@ void CMakeBuildSystem::runCTest() QTC_ASSERT(parameters.isValid(), return); const CommandLine cmd { m_ctestPath, { "-N", "--show-only=json-v1" } }; - const FilePath workingDirectory = buildDirectory(parameters); + ensureBuildDirectory(parameters); + const FilePath workingDirectory = parameters.buildDirectory; const Environment environment = buildConfiguration()->environment(); auto future = Utils::runAsync([cmd, workingDirectory, environment] diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h index 37b076b939d..bb505b65f34 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.h @@ -191,7 +191,7 @@ private: void wireUpConnections(); - Utils::FilePath buildDirectory(const BuildDirParameters ¶meters); + void ensureBuildDirectory(const BuildDirParameters ¶meters); void stopParsingAndClearState(); void becameDirty();