Commit Graph

31 Commits

Author SHA1 Message Date
Christian Kandeler
990aa5e45b CppTools: Adapt autotest
Amends 370804c2ab.

Change-Id: I054a44948cd4a473ae22284d7669c4a7adb2fc86
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-01 10:15:04 +00:00
Eike Ziller
3b76714290 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml

Change-Id: Ie5deacd39ae4f3c0966e7cb41a8fd832dcefbb09
2020-09-03 12:18:02 +02:00
Orgad Shaneh
a408bcfd3d Clang: Add conditions for adding exceptions flag
For GCC it can be deduced from the compiler flags, so no correction is
needed.

For MSVC it can be deduced from the detected defines.

Amends 26693e8212.

Change-Id: Ie4850f328a2afdb3e5158c58f8c30a2644d9c592
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-09-02 15:26:19 +00:00
Christian Kandeler
d65ef60ea2 clang: Fix include/resource dir confusion
The getClangResourceDirAndVersion() function in ClangTools could return
the actual resource dir or the include dir, depending on the input. This
mistake happened because of misleading names spread all around the code.
Now the function returns what it says, and the other names are accurate
as well.

Change-Id: I0a8600857ee7b9fafb16256e0d1ad203ac3273d2
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-08-24 10:18:30 +00:00
Christian Kandeler
782ca5d8d8 Clang: Fix error when including float.h with mingw
Prevent mingw from trying to #include_next a private header from a path
we cannot add to our list of includes.

Fixes: QTCREATORBUG-24251
Task-number: QTCREATORBUG-24027
Change-Id: I18a9db130b9c2265cd208c3506d08d2e1c4cee45
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-07-09 17:24:16 +00:00
Nikolai Kosjar
26693e8212 Revert "Clang: Stop enabling exceptions explicitly"
This reverts commit b114f77d8a as
"--driver-mode=cl" apparently still disables exceptions.

Task-number: QTCREATORBUG-23000
Change-Id: I9c49d971fafda5e1aca8445f8921e50f323d368f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-20 22:46:02 +00:00
Nikolai Kosjar
8f6eb41cad Clang: Ensure that platform codegen flags get also filtered
Leave the function addExtraCodeModelFlags() around as it's used by
ClangPchManager::ProjectUpdater::toolChainArguments().

This allows us to filter out excess target arguments in a follow-up
change.

Change-Id: I742d713dd1ca6c391ba77c52555dcf4e94cc2ff9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-22 11:46:42 +00:00
Nikolai Kosjar
6ee08c0289 Clang: Simplify include paths in tests
* The paths on Linux are always "canonicalized" by
  GccToolChain::gccHeaderPaths(). Therefore, canonicalize the paths in the
  tests, soo.
* Introduce some helper functions to shorten the code.
* Do not break the strings literal paths as this complicates comparing
  them.

Change-Id: I0fc8acde0e455a7974baae0d9fdffd3a4060ff74
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-11 13:08:46 +00:00
Nikolai Kosjar
6156c59c62 Clang: Put clang's resource dir after /usr/local/include
...also on Linux.

That's what clang invoked from the command line does.

Change-Id: I59c48d11fab3b944bb42ca7bb4cd9093a735df60
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-11 13:08:28 +00:00
Eike Ziller
8452264a18 CppTools: Move QtVersion and BuildTargetType
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.

BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).

Removes dependency on ProjectPart from RawProjectPart.

Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-10 07:31:21 +00:00
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