ProjectExplorer: Use FilePath for sysroots

... and reduce to the relevant part when passing to cmake.

Task-number: QTCREATORBUG-27229
Change-Id: I7cde2ff04530caf439d6707c2c6d15a8e734ae0b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-06-30 09:08:47 +02:00
parent c294df1d3a
commit 3be472c8d2
15 changed files with 34 additions and 32 deletions

View File

@@ -45,6 +45,7 @@
using namespace CppEditor;
using namespace ProjectExplorer;
using namespace Utils;
namespace CompilationDatabaseProjectManager {
namespace Internal {
@@ -124,7 +125,7 @@ public:
QStringList flags;
QString fileName;
QString workingDir;
QString sysRoot;
FilePath sysRoot;
};
}
@@ -183,8 +184,8 @@ void CompilationDatabaseTests::testFilterArguments()
{"RELATIVE_PLUGIN_PATH", "\"../lib/qtcreator/plugins\""},
{"QT_CREATOR", "1"}}));
QCOMPARE(testData.fileKind, CppEditor::ProjectFile::Kind::CXXSource);
QCOMPARE(testData.sysRoot, HostOsInfo::isWindowsHost() ? QString("C:\\sysroot\\embedded")
: QString("/opt/sysroot/embedded"));
QCOMPARE(testData.sysRoot.toString(), HostOsInfo::isWindowsHost() ? QString("C:\\sysroot\\embedded")
: QString("/opt/sysroot/embedded"));
}
static QString kCmakeCommand