forked from qt-creator/qt-creator
Android: Force reset/update of pre-existing toolchains
Toolchains are only (re-)created if the NDK changes. And till now, the environment for the toolchain was only set during its creation. However, if the user only changes the JDK location, we don't want to recreate the toolchain but to still update the JAVA_HOME variable for the environment. This change does so that resetToolChain() is called also for pre- existing toolchains (not just the newly created ones). That triggers a call of addToEnvironment(), which sets the potentially updated JAVA_HOME variable. Fixes: QTCREATORBUG-28827 Change-Id: Id55f59f3ef3c8bfbb2b811052e0f60f495843dc3 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
@@ -230,9 +230,14 @@ ToolChainList AndroidToolChainFactory::autodetectToolChainsFromNdks(
|
|||||||
atc->setPlatformCodeGenFlags({"-target", target});
|
atc->setPlatformCodeGenFlags({"-target", target});
|
||||||
atc->setPlatformLinkerFlags({"-target", target});
|
atc->setPlatformLinkerFlags({"-target", target});
|
||||||
atc->setDisplayName(displayName);
|
atc->setDisplayName(displayName);
|
||||||
atc->resetToolChain(compilerCommand);
|
|
||||||
tc = atc;
|
tc = atc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not only reset newly created toolchains. This triggers call to
|
||||||
|
// addToEnvironment, so that e.g. JAVA_HOME gets updated.
|
||||||
|
if (auto gccTc = dynamic_cast<GccToolChain*>(tc))
|
||||||
|
gccTc->resetToolChain(compilerCommand);
|
||||||
|
|
||||||
tc->setDetection(ToolChain::AutoDetection);
|
tc->setDetection(ToolChain::AutoDetection);
|
||||||
result << tc;
|
result << tc;
|
||||||
++targetItr;
|
++targetItr;
|
||||||
|
Reference in New Issue
Block a user