forked from qt-creator/qt-creator
CMake: Make sure source/build directories are reachable
Change-Id: Iea4547807b3a59eb9a8cb70d51d9015dbc8013e3 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -852,9 +852,31 @@ 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()));
|
||||
if (!buildConfiguration()->createBuildDirectory()) {
|
||||
handleParsingFailed(tr("Failed to create build directory \"%1\".").arg(bdir.toUserOutput()));
|
||||
return;
|
||||
}
|
||||
|
||||
const CMakeTool *tool = parameters.cmakeTool();
|
||||
if (!tool) {
|
||||
handleParsingFailed(tr("No CMake tool set up in kit."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (tool->cmakeExecutable().needsDevice()) {
|
||||
if (bdir.needsDevice()) {
|
||||
if (bdir.scheme() != tool->cmakeExecutable().scheme()
|
||||
|| bdir.host() != tool->cmakeExecutable().host()) {
|
||||
handleParsingFailed(
|
||||
tr("The CMake executable and the build directory are not on the same device."));
|
||||
return;
|
||||
}
|
||||
} else if (!tool->cmakeExecutable().ensureReachable(bdir)) {
|
||||
// Make sure that the build directory is available on the device.
|
||||
handleParsingFailed(
|
||||
tr("The remote CMake executable cannot write to the local build directory."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMakeBuildSystem::stopParsingAndClearState()
|
||||
|
||||
Reference in New Issue
Block a user