Commit Graph

21 Commits

Author SHA1 Message Date
Nikolai Kosjar
b9d3055e72 Clang: Allow to forward warnings flags from build system
Change-Id: I47ebb1ce4f3b5544408eb1d0f891ed5090394282
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 11:36:55 +00:00
Ivan Donchevskii
093673e9cf Clang: Fix how tweaked header paths work
We need to provide built-in includes only when we use tweaked headers.
Also let's require Clang resource directory because it has to be
placed on the specific position inside the built-in header paths.

Change-Id: Id581238660c680725201de759216cf33f69f6cc7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-23 12:04:40 +00:00
Ivan Donchevskii
0679c2ff25 Clang: Never use toolchain defines
The known cases provide enough flags not to require
toolchain defines.

Change-Id: Ia7e08a90eca6ea9474db40683ac1e63236f8643d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-16 12:18:55 +00:00
Ivan Donchevskii
0348009e0e Clang: Support MSVC style of compiler flags
Clang has MSVC compatible mode which works with MSVC style command line
flags.

When possible use the same flags (-I, -D, -U, etc.) and in other cases
either replace by MSVC analog (for example use /FI instead of -include)
or pass the argument with '/clang:' prefix (requires
https://reviews.llvm.org/D53457).

Change-Id: I95f33bed5dc8d9493895ed8d4359cdd70fc774b8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-16 12:17:31 +00:00
Nikolai Kosjar
4c0c3f5a64 Clang: Forward compiler options for gcc/clang
Rely on clang to do the "right thing" with them.

Change-Id: I44adf2cd5c61549896da3fc9b7c35c2fb0142060
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-16 11:47:29 +00:00
Marco Bubke
5dbaf387ba Utils: Move C++ language details from ProjectExplorer to Utils
We want to use them in the backend processes too so it's nice to share them
in Utils. A concrete size was added too because they should be serialized.

Change-Id: Id5eb8f46643d5159f034fc9559f68a08d7e5847a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-15 10:37:03 +00:00
Nikolai Kosjar
7109e8f050 Clang: Minor cleanups in CompilerOptionsBuilder
Change-Id: Iaf5af70136bceed52d19622c01d9d7147e5abeea
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-11 07:20:52 +00:00
Nikolai Kosjar
b114f77d8a Clang: Stop enabling exceptions explicitly
According to commit e2e3be09e3 this was
needed for clang 3.8.0 on Windows.

Change-Id: I4f2c2bf31449d9613607e57524c7ff6e4577812a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-09 15:03:25 +00:00
Ivan Donchevskii
167150396d Clang: Fix CompilerOptionsBuilder test
Amends commit f6b8302efd.

Change-Id: Ia4041fcf590e5b85b9422047afa91d4d98837121
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-12-20 12:47:34 +00:00
Eike Ziller
9084ca73df Merge remote-tracking branch 'origin/4.8'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I87f47cecbb924064296a002fd9446a0627acad8e
2018-12-12 09:44:13 +01:00
Ivan Donchevskii
aa70799795 Clang: Always force the built-in includes order
C++ includes must always come first, then clang resource
directory and then everything else.
This prevents both c++ standard headers and intrinsics issues.

Change-Id: Ia21bfa2fe99884c9adf58f7ef6beba1bede1724b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-12-11 07:49:09 +00:00
Eike Ziller
e5c2ee922a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I743ea39480cc5c7b6febcd2e93713d15a3ae6d9c
2018-12-07 08:53:11 +01:00
Nikolai Kosjar
c7c800a73e CppTools: Split CppTools::UseBuiltin in two options
...for clarity.

No behavior change.

Change-Id: Id0334bc79b97a8ff53b37089e337530c9a01b1d4
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-12-04 14:57:20 +00:00
Nikolai Kosjar
273157c2a1 Clang: Unify CompilerOptionsBuilder options
No behavior change.

Sometimes we use "SkipX, sometimes "UseX". Unify to "UseX" as this is
more natural to read.

Change-Id: Ib08bdb4cde93ed55fdb9c855566b10a3933cae37
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-03 15:19:03 +00:00
Nikolai Kosjar
0c38e3aea7 Clang: Clean up CompilerOptionsBuilder
No behavior change.

* Remove virtual from methods that are not overridden
* Move constant member functions that do no access any members into
  source file as static functions
* Remove QLatin1String where possible
* Make variable names a bit more consistent
* Other minor stuff

Change-Id: I34a582d5a468489e11365507b283e9aee157664f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-03 12:58:31 +00:00
Nikolai Kosjar
6e75e7f4e4 Clang: Fix failing unit test
...amends 12dce3ef7d.

Change-Id: I93ef9b4dfaf0bbe9f4be1d0f2688eb5726938c81
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-03 08:11:55 +00:00
Ivan Donchevskii
053b2090b4 Clang: Fix C++ paths search in compiler options builder
Take into account paths from MinGW and NDK Clang.

Fixes: QTCREATORBUG-21540
Change-Id: I00906c75dc4ddeb92fe5942a0222285d8ce2eb9d
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-11-21 13:18:22 +00:00
Marco Bubke
77b5907c57 Don't remove __cplusplus
For the indexing we need all tool chain macros. Originally it was a fix
because the C++ version of the project part and __cplusplus could be
different but now they should be the same. They will be now removed in the
compiler options builder.

Change-Id: I7ae8721a29632473e76ecedb411a6c9001e5e199
Task-number: QTCREATORBUG-21265
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-10 12:25:30 +00:00
Ivan Donchevskii
76fad7aad0 Unittest: Fix compileroptionsbuilder-test paths on Linux
Match paths partially not to construct the whole path.

Change-Id: I397ac930e2d74b8eba98d1b523aabd4ed92f2aee
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-09 12:25:14 +00:00
Nikolai Kosjar
6aa11eb75e CppTools/ProjectExplorer: Remove enum duplication
... between CppTools::ProjectPart and ProjectExplorer::ToolChain.

Change-Id: I8b448747e454adbed77547460383b8515462cc81
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-08 12:34:57 +00:00
Ivan Donchevskii
f6e5202b80 CompilerOptionsBuilder unit-tests
Bonus: minor compiler options builder issues fixed.

Change-Id: Ie25f8fad6729339de05f2bf9b614ceac873e2634
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-04 10:24:13 +00:00