Clang: Fix clang-cl environment

The environment depends on vcvars script and with
current way of clang-cl initialization we need to
call it again when vcvars are updated.

Change-Id: I5ccf34861b711c2514203408db62e2a134592721
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-11-30 11:39:39 +01:00
parent 445b7a6242
commit bb00d3fb0e
2 changed files with 6 additions and 1 deletions

View File

@@ -1102,6 +1102,10 @@ void ClangClToolChain::resetMsvcToolChain(const MsvcToolChain *base)
m_abi = base->targetAbi();
m_vcvarsBat = base->varsBat();
setVarsBatArg(base->varsBatArg());
initEnvModWatcher(Utils::runAsync(envModThreadPool(),
&ClangClToolChain::environmentModifications,
m_vcvarsBat, base->varsBatArg()));
}
bool ClangClToolChain::operator ==(const ToolChain &other) const

View File

@@ -97,7 +97,6 @@ protected:
LanguageVersion msvcLanguageVersion(const Core::Id &language,
const Macros &macros) const override;
private:
struct GenerateEnvResult
{
Utils::optional<QString> error;
@@ -106,6 +105,8 @@ private:
static void environmentModifications(QFutureInterface<GenerateEnvResult> &future,
QString vcvarsBat, QString varsBatArg);
void initEnvModWatcher(const QFuture<GenerateEnvResult> &future);
private:
void updateEnvironmentModifications(QList<Utils::EnvironmentItem> modifications);
mutable QList<Utils::EnvironmentItem> m_environmentModifications;