forked from qt-creator/qt-creator
Clang: Undefine language features as fix for MSVC2015/clang-3.8.0
This applies the following change for the clang code model, too.
commit d13d179524
Clang Static Analyzer: Workaround analyzing MSVC2015 projects with clang 3.8.0 II
Change-Id: Ia229d7e8b24c2e1c0a83d9a53c623ea1f79c4a06
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -28,10 +28,12 @@
|
||||
#include "cppprojectfile.h"
|
||||
#include "cpptoolsconstants.h"
|
||||
|
||||
#include <projectexplorer/abi.h>
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
|
||||
@@ -279,6 +281,18 @@ QString targetTriple(ProjectExplorer::Project *project, const Core::Id &toolchai
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool projectHasMsvc2015Toolchain(ProjectExplorer::Project *project)
|
||||
{
|
||||
if (project) {
|
||||
if (ProjectExplorer::Target *target = project->activeTarget()) {
|
||||
if (ProjectExplorer::RunConfiguration *runConfig = target->activeRunConfiguration())
|
||||
return runConfig->abi().osFlavor() == ProjectExplorer::Abi::WindowsMsvc2015Flavor;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -341,6 +355,7 @@ void ProjectPartBuilder::evaluateProjectPartToolchain(
|
||||
|
||||
projectPart->toolchainDefines = toolChain->predefinedMacros(commandLineFlags);
|
||||
projectPart->toolchainType = toolChain->typeId();
|
||||
projectPart->isMsvc2015Toolchain = projectHasMsvc2015Toolchain(projectPart->project);
|
||||
projectPart->targetTriple = targetTriple(projectPart->project, toolChain->typeId());
|
||||
projectPart->updateLanguageFeatures();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user