forked from qt-creator/qt-creator
Run the analyzer within the build environment.
This is especially important for clang-cl, which requires the environment set by e.g. vcvars32.bat [1]. [1] http://clang.llvm.org/docs/UsersManual.html#clang-cl Change-Id: If319bb94752bbef9207581c50173dde99af007bc Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <cpptools/cppmodelmanager.h>
|
||||
#include <cpptools/cppprojects.h>
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/gcctoolchain.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
@@ -99,6 +100,10 @@ RunControl *ClangStaticAnalyzerRunControlFactory::create(RunConfiguration *runCo
|
||||
AnalyzerStartParameters sp;
|
||||
sp.runMode = runMode;
|
||||
sp.startMode = StartLocal;
|
||||
BuildConfiguration * const buildConfiguration = target->activeBuildConfiguration();
|
||||
QTC_ASSERT(buildConfiguration, return 0);
|
||||
sp.environment = buildConfiguration->environment();
|
||||
|
||||
return AnalyzerManager::createRunControl(sp, runConfiguration);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user