Merge remote-tracking branch 'origin/11.0' into qds/dev

Change-Id: I2bf1a2a72d9765d9b4088840414b4933644db47a
This commit is contained in:
Tim Jenssen
2023-09-14 14:16:37 +02:00
40 changed files with 8404 additions and 6385 deletions

View File

@@ -184,15 +184,16 @@ static QString initialStagingDir(Kit *kit)
static bool supportsStageForInstallation(const Kit *kit)
{
IDeviceConstPtr runDevice = DeviceKitAspect::device(kit);
Id runDeviceType = DeviceTypeKitAspect::deviceTypeId(kit);
IDeviceConstPtr buildDevice = BuildDeviceKitAspect::device(kit);
QTC_ASSERT(runDevice, return false);
QTC_ASSERT(runDeviceType.isValid(), return false);
QTC_ASSERT(buildDevice, return false);
return runDevice->id() != buildDevice->id()
&& runDevice->type() != Android::Constants::ANDROID_DEVICE_TYPE
&& runDevice->type() != Ios::Constants::IOS_DEVICE_TYPE
&& runDevice->type() != Ios::Constants::IOS_SIMULATOR_TYPE
&& runDevice->type() != BareMetal::Constants::BareMetalOsType
&& runDevice->type() != WebAssembly::Constants::WEBASSEMBLY_DEVICE_TYPE;
return (!runDevice || runDevice->id() != buildDevice->id())
&& runDeviceType != Android::Constants::ANDROID_DEVICE_TYPE
&& runDeviceType != Ios::Constants::IOS_DEVICE_TYPE
&& runDeviceType != Ios::Constants::IOS_SIMULATOR_TYPE
&& runDeviceType != BareMetal::Constants::BareMetalOsType
&& runDeviceType != WebAssembly::Constants::WEBASSEMBLY_DEVICE_TYPE;
}
CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Id id) :

View File

@@ -272,6 +272,8 @@ bool CMakeBuildSystem::addFiles(Node *context, const FilePaths &filePaths, FileP
const int targetDefinitionLine = target.backtrace.last().line;
// Have a fresh look at the CMake file, not relying on a cached value
Core::DocumentManager::saveModifiedDocumentSilently(
Core::DocumentModel::documentForFilePath(targetCMakeFile));
expected_str<QByteArray> fileContent = targetCMakeFile.fileContents();
cmListFile cmakeListFile;
std::string errorString;
@@ -397,6 +399,8 @@ CMakeBuildSystem::projectFileArgumentPosition(const QString &targetName, const Q
const FilePath targetCMakeFile = target.backtrace.last().path;
// Have a fresh look at the CMake file, not relying on a cached value
Core::DocumentManager::saveModifiedDocumentSilently(
Core::DocumentModel::documentForFilePath(targetCMakeFile));
expected_str<QByteArray> fileContent = targetCMakeFile.fileContents();
cmListFile cmakeListFile;
std::string errorString;
@@ -657,7 +661,7 @@ FilePaths CMakeBuildSystem::filesGeneratedFrom(const FilePath &sourceFile) const
const QString generatedFileName = "ui_" + sourceFile.completeBaseName() + ".h";
auto targetNode = this->project()->nodeForFilePath(sourceFile);
while (!dynamic_cast<const CMakeTargetNode *>(targetNode))
while (targetNode && !dynamic_cast<const CMakeTargetNode *>(targetNode))
targetNode = targetNode->parentFolderNode();
FilePaths generatedFilePaths;

View File

@@ -180,10 +180,10 @@ QVector<FolderNode::LocationInfo> extractBacktraceInformation(const BacktraceInf
return info;
}
static bool isChildOf(const FilePath &path, const QStringList &prefixes)
static bool isChildOf(const FilePath &path, const FilePaths &prefixes)
{
for (const QString &prefix : prefixes)
if (path.isChildOf(FilePath::fromString(prefix)))
for (const FilePath &prefix : prefixes)
if (path == prefix || path.isChildOf(prefix))
return true;
return false;
}

View File

@@ -35,7 +35,7 @@ const QStringList CMAKE_QUERY_FILENAMES = {"cache-v2", "codemodel-v2", "cmakeFil
// Helper:
// --------------------------------------------------------------------
static FilePath cmakeReplyDirectory(const FilePath &buildDirectory)
FilePath FileApiParser::cmakeReplyDirectory(const FilePath &buildDirectory)
{
return buildDirectory.pathAppended(CMAKE_RELATIVE_REPLY_PATH);
}
@@ -795,7 +795,7 @@ FilePath FileApiDetails::ReplyFileContents::jsonFile(const QString &kind, const
// FileApi:
// --------------------------------------------------------------------
bool FileApiParser::setupCMakeFileApi(const FilePath &buildDirectory, Utils::FileSystemWatcher &watcher)
bool FileApiParser::setupCMakeFileApi(const FilePath &buildDirectory)
{
// So that we have a directory to watch.
buildDirectory.pathAppended(CMAKE_RELATIVE_REPLY_PATH).ensureWritableDir();
@@ -818,7 +818,6 @@ bool FileApiParser::setupCMakeFileApi(const FilePath &buildDirectory, Utils::Fil
}
}
watcher.addDirectory(cmakeReplyDirectory(buildDirectory).path(), FileSystemWatcher::WatchAllChanges);
return true;
}
@@ -842,7 +841,6 @@ FileApiData FileApiParser::parseData(QPromise<std::shared_ptr<FileApiQtcData>> &
QString &errorMessage)
{
QTC_CHECK(errorMessage.isEmpty());
QTC_CHECK(!replyFilePath.needsDevice());
const FilePath replyDir = replyFilePath.parentDir();
FileApiData result;

View File

@@ -227,9 +227,9 @@ public:
const QString &cmakeBuildType,
QString &errorMessage);
static bool setupCMakeFileApi(const Utils::FilePath &buildDirectory,
Utils::FileSystemWatcher &watcher);
static bool setupCMakeFileApi(const Utils::FilePath &buildDirectory);
static Utils::FilePath cmakeReplyDirectory(const Utils::FilePath &buildDirectory);
static Utils::FilePaths cmakeQueryFilePaths(const Utils::FilePath &buildDirectory);
static Utils::FilePath scanForCMakeReplyFile(const Utils::FilePath &buildDirectory);

View File

@@ -59,7 +59,7 @@ void FileApiReader::setParameters(const BuildDirParameters &p)
// Reset watcher:
m_watcher.clear();
FileApiParser::setupCMakeFileApi(m_parameters.buildDirectory, m_watcher);
FileApiParser::setupCMakeFileApi(m_parameters.buildDirectory);
resetData();
}
@@ -361,7 +361,10 @@ void FileApiReader::cmakeFinishedState(int exitCode)
if (m_lastCMakeExitCode != 0)
makeBackupConfiguration(false);
FileApiParser::setupCMakeFileApi(m_parameters.buildDirectory, m_watcher);
FileApiParser::setupCMakeFileApi(m_parameters.buildDirectory);
m_watcher.addDirectory(FileApiParser::cmakeReplyDirectory(m_parameters.buildDirectory).path(),
FileSystemWatcher::WatchAllChanges);
endState(FileApiParser::scanForCMakeReplyFile(m_parameters.buildDirectory),
m_lastCMakeExitCode != 0);