Merge remote-tracking branch 'origin/5.0'

Conflicts:
	src/libs/utils/processreaper.cpp
	src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
	src/plugins/cmakeprojectmanager/cmakeprocess.cpp

Change-Id: Ie248bcb02a80f3e02ab19d73033ce2ba31e7fd83
This commit is contained in:
Eike Ziller
2021-09-07 08:56:42 +02:00
101 changed files with 1050 additions and 663 deletions

View File

@@ -71,7 +71,6 @@ struct DirectoryData
BaseQtVersion::QmakeBuildConfigs buildConfig;
QString additionalArguments;
QMakeStepConfig config;
QMakeStepConfig::TargetArchConfig archConfig;
QMakeStepConfig::OsType osType;
};
@@ -154,10 +153,8 @@ QList<void *> QmakeProjectImporter::examineDirectory(const FilePath &importPath,
qCDebug(logs) << " qt version:" << version->displayName() << " temporary:" << isTemporaryVersion;
data->archConfig = parse.config().archConfig;
data->osType = parse.config().osType;
qCDebug(logs) << " archConfig:" << data->archConfig;
qCDebug(logs) << " osType: " << data->osType;
if (version->type() == QLatin1String(IOSQT)
&& data->osType == QMakeStepConfig::NoOsType) {
@@ -165,20 +162,6 @@ QList<void *> QmakeProjectImporter::examineDirectory(const FilePath &importPath,
qCDebug(logs) << " IOS found without osType, adjusting osType" << data->osType;
}
if (version->type() == QtSupport::Constants::DESKTOPQT) {
const ProjectExplorer::Abis abis = version->qtAbis();
if (!abis.isEmpty()) {
ProjectExplorer::Abi abi = abis.first();
if (abi.os() == ProjectExplorer::Abi::DarwinOS) {
if (abi.wordWidth() == 64)
data->archConfig = QMakeStepConfig::X86_64;
else
data->archConfig = QMakeStepConfig::X86;
qCDebug(logs) << " OS X found without targetarch, adjusting archType" << data->archConfig;
}
}
}
// find qmake arguments and mkspec
data->additionalArguments = parse.unparsedArguments();
qCDebug(logs) << " Unparsed arguments:" << data->additionalArguments;
@@ -210,27 +193,23 @@ bool QmakeProjectImporter::matchKit(void *directoryData, const Kit *k) const
ToolChain *tc = ToolChainKitAspect::cxxToolChain(k);
if (kitSpec.isEmpty() && kitVersion)
kitSpec = kitVersion->mkspecFor(tc);
QMakeStepConfig::TargetArchConfig kitTargetArch = QMakeStepConfig::NoArch;
QMakeStepConfig::OsType kitOsType = QMakeStepConfig::NoOsType;
if (tc) {
kitTargetArch = QMakeStepConfig::targetArchFor(tc->targetAbi(), kitVersion);
kitOsType = QMakeStepConfig::osTypeFor(tc->targetAbi(), kitVersion);
}
qCDebug(logs) << k->displayName()
<< "version:" << (kitVersion == data->qtVersionData.qt)
<< "spec:" << (kitSpec == data->parsedSpec)
<< "targetarch:" << (kitTargetArch == data->archConfig)
<< "ostype:" << (kitOsType == data->osType);
return kitVersion == data->qtVersionData.qt
&& kitSpec == data->parsedSpec
&& kitTargetArch == data->archConfig
&& kitOsType == data->osType;
}
Kit *QmakeProjectImporter::createKit(void *directoryData) const
{
auto *data = static_cast<DirectoryData *>(directoryData);
return createTemporaryKit(data->qtVersionData, data->parsedSpec, data->archConfig, data->osType);
return createTemporaryKit(data->qtVersionData, data->parsedSpec, data->osType);
}
const QList<BuildInfo> QmakeProjectImporter::buildInfoList(void *directoryData) const
@@ -262,17 +241,14 @@ void QmakeProjectImporter::deleteDirectoryData(void *directoryData) const
delete static_cast<DirectoryData *>(directoryData);
}
static const QList<ToolChain *> preferredToolChains(BaseQtVersion *qtVersion, const QString &ms,
const QMakeStepConfig::TargetArchConfig &archConfig)
static const QList<ToolChain *> preferredToolChains(BaseQtVersion *qtVersion, const QString &ms)
{
const QString spec = ms.isEmpty() ? qtVersion->mkspec() : ms;
const QList<ToolChain *> toolchains = ToolChainManager::toolChains();
const Abis qtAbis = qtVersion->qtAbis();
const auto matcher = [&](const ToolChain *tc) {
return qtAbis.contains(tc->targetAbi())
&& tc->suggestedMkspecList().contains(spec)
&& QMakeStepConfig::targetArchFor(tc->targetAbi(), qtVersion) == archConfig;
return qtAbis.contains(tc->targetAbi()) && tc->suggestedMkspecList().contains(spec);
};
ToolChain * const cxxToolchain = findOrDefault(toolchains, [matcher](const ToolChain *tc) {
return tc->language() == ProjectExplorer::Constants::CXX_LANGUAGE_ID && matcher(tc);
@@ -290,13 +266,11 @@ static const QList<ToolChain *> preferredToolChains(BaseQtVersion *qtVersion, co
Kit *QmakeProjectImporter::createTemporaryKit(const QtProjectImporter::QtVersionData &data,
const QString &parsedSpec,
const QMakeStepConfig::TargetArchConfig &archConfig,
const QMakeStepConfig::OsType &osType) const
{
Q_UNUSED(osType) // TODO use this to select the right toolchain?
return QtProjectImporter::createTemporaryKit(data,
[&data, parsedSpec, archConfig](Kit *k) -> void {
for (ToolChain * const tc : preferredToolChains(data.qt, parsedSpec, archConfig))
return QtProjectImporter::createTemporaryKit(data, [&data, parsedSpec](Kit *k) -> void {
for (ToolChain *const tc : preferredToolChains(data.qt, parsedSpec))
ToolChainKitAspect::setToolChain(k, tc);
if (parsedSpec != data.qt->mkspec())
QmakeKitAspect::setMkspec(k, parsedSpec, QmakeKitAspect::MkspecSource::Code);