From e54c63af5eb20e6bfcc59dd600b489fa38682767 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 23 Aug 2021 13:56:38 +0200 Subject: [PATCH] CMake: Bark when selected cmake binary and build dir on different hosts Change-Id: I31d373cb6a87c65dbf42ae4e0b295d41f94d9f63 Reviewed-by: hjk Reviewed-by: Artem Sokolovskii --- src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index ae39d5f9182..0cc26380661 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -109,6 +109,13 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & connect(process.get(), &QtcProcess::finished, this, &CMakeProcess::handleProcessFinished); + if (buildDirectory.needsDevice()) { + if (cmake->cmakeExecutable().host() != buildDirectory.host()) { + m_parser.appendMessage(tr("CMake executable and build dir must be on the same device."), StdErrFormat); + reportCanceled(); + return; + } + } CommandLine commandLine(cmake->cmakeExecutable(), QStringList({"-S", srcDir, "-B", buildDirectory.path()}) + arguments); TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);