ProjectExplorer: Do not set GCC install dir during auto-detection

The accessor has lazy evaluation built in, so no need to set the value
prematurely.
This reduces the amount of calls to the gcc binary at initial start-up
by a third, which corresponds to ~500 ms on my machine.

Change-Id: I35fb290c5f3e7572a129e4fdb1e4c8b12e766ad1
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2022-01-21 16:50:25 +01:00
parent 1ed92cf926
commit b85e2bc17b

View File

@@ -1177,9 +1177,6 @@ Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription &
const GccToolChain::DetectedAbisResult detectedAbis = guessGccAbi(localCompilerPath, const GccToolChain::DetectedAbisResult detectedAbis = guessGccAbi(localCompilerPath,
systemEnvironment, systemEnvironment,
macros); macros);
const Utils::FilePath installDir = gccInstallDir(localCompilerPath,
systemEnvironment);
for (const Abi &abi : detectedAbis.supportedAbis) { for (const Abi &abi : detectedAbis.supportedAbis) {
std::unique_ptr<GccToolChain> tc(dynamic_cast<GccToolChain *>(create())); std::unique_ptr<GccToolChain> tc(dynamic_cast<GccToolChain *>(create()));
if (!tc) if (!tc)
@@ -1195,7 +1192,6 @@ Toolchains GccToolChainFactory::autoDetectToolChain(const ToolChainDescription &
tc->setSupportedAbis(detectedAbis.supportedAbis); tc->setSupportedAbis(detectedAbis.supportedAbis);
tc->setTargetAbi(abi); tc->setTargetAbi(abi);
tc->setOriginalTargetTriple(detectedAbis.originalTargetTriple); tc->setOriginalTargetTriple(detectedAbis.originalTargetTriple);
tc->setInstallDir(installDir);
tc->setDisplayName(tc->defaultDisplayName()); // reset displayname tc->setDisplayName(tc->defaultDisplayName()); // reset displayname
if (!checker || checker(tc.get())) if (!checker || checker(tc.get()))
result.append(tc.release()); result.append(tc.release());