From ba004e409f3f2dec9725317357fb0dddc987132c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 25 May 2023 15:40:40 +0200 Subject: [PATCH] QMake: Fix build device root Fixes: QTCREATORBUG-29140 Change-Id: I85a7ea54c9006079c1c270ded0a5bd9848db1408 Reviewed-by: Reviewed-by: hjk --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 1a180bf833b..d7aefb50b8b 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -1452,8 +1453,12 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const QString QmakeBuildSystem::deviceRoot() const { - if (projectFilePath().needsDevice()) - return projectFilePath().withNewPath("/").toFSPathString(); + IDeviceConstPtr device = BuildDeviceKitAspect::device(target()->kit()); + QTC_ASSERT(device, return {}); + FilePath deviceRoot = device->rootPath(); + if (deviceRoot.needsDevice()) + return deviceRoot.toFSPathString(); + return {}; }