CMake: avoid running into some code path that breaks later

When trying to configure a CMake project on a remote linux device,
there's currently PATH=/some/local/dir/for/ninja added on the ssh
command line, which won't work with the remote cmake.

Change-Id: I97adb58e4c8b33f74edcc37a7b2cfb00c764b829
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
hjk
2022-10-05 18:35:52 +02:00
parent 47e5997e57
commit 0e3d1064e6

View File

@@ -2079,6 +2079,11 @@ FilePath CMakeBuildConfiguration::sourceDirectory() const
void CMakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const
{
const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit());
// The hack further down is only relevant for desktop
if (tool && tool->cmakeExecutable().needsDevice())
return;
CMakeSpecificSettings *settings = CMakeProjectPlugin::projectTypeSpecificSettings();
if (!settings->ninjaPath.filePath().isEmpty()) {
const Utils::FilePath ninja = settings->ninjaPath.filePath();