ClangStaticAnalyzer: Set target explicitly for gcc toolchains

The default target of clang.exe might be unfavorable since it depends on
e.g. the tool chain used to build clang.exe:

                            default target
     clang build with msvc: i686-pc-windows-msvc
    clang build with mingw: i686-pc-windows-gnu

The correct target is important since it not only has implications on
the built-in macros and include paths, but also on parsing options. For
example, the msvc target silently adds the following parsing options

    -fms-extensions
    -fms-compatibility
    -fms-compatibility-version=17.00
    -fdelayed-template-parsing

...as can be seen by the output of

    $ clang.exe -### empty.cpp

Change-Id: Icd8aaf11016e59f37025cbf1c97da81511ff249b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2016-03-04 15:33:33 +01:00
parent 5c030a4336
commit 768c900990
2 changed files with 39 additions and 9 deletions

View File

@@ -83,6 +83,7 @@ private:
private:
const CppTools::ProjectInfo m_projectInfo;
const unsigned char m_wordWidth;
QString m_targetTriple;
Utils::Environment m_environment;
QString m_clangExecutable;