forked from qt-creator/qt-creator
ProjectExplorer: Use device env when inspecting gcc
Previously the host environment would be used while inspecting a gcc / g++ compiler. When doing so on a Windows Host against a Docker target, this would fail. Change-Id: I0e7b392101cee23e17813fa07f6c04bb9d3999c9 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -445,7 +445,7 @@ static QStringList filteredFlags(const QStringList &allFlags, bool considerSysro
|
|||||||
ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() const
|
ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() const
|
||||||
{
|
{
|
||||||
// Using a clean environment breaks ccache/distcc/etc.
|
// Using a clean environment breaks ccache/distcc/etc.
|
||||||
Environment env = Environment::systemEnvironment();
|
Environment env = compilerCommand().deviceEnvironment();
|
||||||
addToEnvironment(env);
|
addToEnvironment(env);
|
||||||
const QStringList platformCodeGenFlags = m_platformCodeGenFlags;
|
const QStringList platformCodeGenFlags = m_platformCodeGenFlags;
|
||||||
OptionsReinterpreter reinterpretOptions = m_optionsReinterpreter;
|
OptionsReinterpreter reinterpretOptions = m_optionsReinterpreter;
|
||||||
@@ -852,7 +852,7 @@ void GccToolChain::setOptionsReinterpreter(const OptionsReinterpreter &optionsRe
|
|||||||
|
|
||||||
GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const
|
GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const
|
||||||
{
|
{
|
||||||
Environment env = Environment::systemEnvironment();
|
Environment env = compilerCommand().deviceEnvironment();
|
||||||
addToEnvironment(env);
|
addToEnvironment(env);
|
||||||
ProjectExplorer::Macros macros = createMacroInspectionRunner()({}).macros;
|
ProjectExplorer::Macros macros = createMacroInspectionRunner()({}).macros;
|
||||||
return guessGccAbi(findLocalCompiler(compilerCommand(), env),
|
return guessGccAbi(findLocalCompiler(compilerCommand(), env),
|
||||||
@@ -863,7 +863,7 @@ GccToolChain::DetectedAbisResult GccToolChain::detectSupportedAbis() const
|
|||||||
|
|
||||||
QString GccToolChain::detectVersion() const
|
QString GccToolChain::detectVersion() const
|
||||||
{
|
{
|
||||||
Environment env = Environment::systemEnvironment();
|
Environment env = compilerCommand().deviceEnvironment();
|
||||||
addToEnvironment(env);
|
addToEnvironment(env);
|
||||||
return gccVersion(findLocalCompiler(compilerCommand(), env), env,
|
return gccVersion(findLocalCompiler(compilerCommand(), env), env,
|
||||||
filteredFlags(platformCodeGenFlags(), true));
|
filteredFlags(platformCodeGenFlags(), true));
|
||||||
@@ -871,7 +871,7 @@ QString GccToolChain::detectVersion() const
|
|||||||
|
|
||||||
Utils::FilePath GccToolChain::detectInstallDir() const
|
Utils::FilePath GccToolChain::detectInstallDir() const
|
||||||
{
|
{
|
||||||
Environment env = Environment::systemEnvironment();
|
Environment env = compilerCommand().deviceEnvironment();
|
||||||
addToEnvironment(env);
|
addToEnvironment(env);
|
||||||
return gccInstallDir(findLocalCompiler(compilerCommand(), env), env,
|
return gccInstallDir(findLocalCompiler(compilerCommand(), env), env,
|
||||||
filteredFlags(platformCodeGenFlags(), true));
|
filteredFlags(platformCodeGenFlags(), true));
|
||||||
|
Reference in New Issue
Block a user