Commit Graph

6 Commits

Author SHA1 Message Date
Ivan Donchevskii
38d39fb9f0 CompilationDatabase: Add target to the compilation database project
Target exposes information about kit and toolchain to the outside
and enables tools like Clang-Tidy and Clazy.

Change-Id: I27b73bbb3b810789f6ca3d447b744604f8e61286
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-02 06:59:43 +00:00
Ivan Donchevskii
f604c8a77c CompilationDatabase: Support both code models
Extract headers, defines and fileKind from flags in
order to have complete project parts.

Side-effect: better support for MSVC-specific flags.
Change-Id: Iaa1413c91c96c3cf89ddbe76a7a1f0f46c5289c0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-01 14:52:05 +00:00
Ivan Donchevskii
cb9df98efb CompilationDatabase: Fix escaped quotes handling
Change-Id: Iaecd38f921bd719899e478a76d8a8b9d4230a7cc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-01 10:02:53 +00:00
Ivan Donchevskii
8ab9b93b79 CompilationDatabase: Fix opening relative file paths
Change-Id: I0d0ac8af9cd48510b8b8a80adfb20b8c526cd2e4
Fixes: QTCREATORBUG-21386
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-29 11:45:39 +00:00
Nikolai Kosjar
5900766ecb Toolchains: Detect unspecified language version
We checked the command line from the project manager for "-std=X" and
friends to figure out the language version to use. However, if such a
flag was not provided, we assumed the latest version we support. This
could conflict with the actual version of the compiler and its
predefined macros.

Figure out the version by inspecting __cplusplus/__STDC_VERSION__ in the
predefined macros of the toolchain. The MSVC compiler is an exception to
this, as it does not seem to properly set the value - check for
_MSVC_LANG if possible, otherwise simply assume some versions as before.

While at it, add also support for C17/C18 and the upcoming C++2a.

Task-number: QTCREATORBUG-20884
Task-number: QTCREATORBUG-21188
Change-Id: I464ffcd52d2120c0208275a050e82efda44fae1c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-08 09:07:56 +00:00
Ivan Donchevskii
c99fb5d0bc Plugins: Add compilation database plugin
Introduce compilation database project support.

Pass the arguments list for each file directly to
ClangCodeModel via extraCodeModelFlags therefore
introduce a dependency from the ClangCodeModel plugin.

Change-Id: Iea5760d379de1ea246382dce56de0adf7ab5673d
Task-number: QTCREATORBUG-21115
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-09-19 12:11:36 +00:00