summaryrefslogtreecommitdiff
path: root/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CompilationDatabaseProjectManager: Add missing GCC include flagsAlibek Omarov2023-04-111-2/+2
| | | | | | | GCC also accepts -iquote and -idirafter flags to set include path. Change-Id: Id8088faa4cfcfb9d6005ad13527c0bc26dc4feb3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ProjectExplorer: Proliferate FilePath a bithjk2023-03-151-17/+8
| | | | | Change-Id: Ia671a1de17b9e58764375c5f64cc47b053b0725a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CDBPM: Adapt to change in FilePathChristian Stenger2023-02-151-1/+1
| | | | | | | Silences a soft assert. Change-Id: I976ba259533ab33b23f8b530b277638bf727af59 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Utils: Remove Utils::optionalEike Ziller2022-09-011-3/+4
| | | | | | | | | | Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CompilationDatabaseProjectManager: Be more careful with filteringChristian Kandeler2022-08-021-5/+15
| | | | | | | | | Do not blindly remove all flags that contain the file's base name. Fixes: QTCREATORBUG-27990 Change-Id: Ib51b65a8694e82ec22af859176b0db0e5d86b5f0 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ProjectExplorer: Use FilePath for sysrootshjk2022-06-301-2/+3
| | | | | | | | | ... and reduce to the relevant part when passing to cmake. Task-number: QTCREATORBUG-27229 Change-Id: I7cde2ff04530caf439d6707c2c6d15a8e734ae0b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CompilationDatabaseProjectManager: Fix flags extractionChristian Kandeler2022-06-201-1/+1
| | | | | | | | | | The code would blindly remove all "options" starting with /, which meant that all file paths arguments got lost on Unix-like hosts. Fixes: QTCREATORBUG-22949 Change-Id: I43e2b1e57ed0e9ced9da8fa46d98d9ac25f83d13 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-9/+9
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Drop Utils::SkipEmptyParts againhjk2020-07-211-1/+1
| | | | | | | | We require Qt 5.14 nowadays. Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Fix Qt 5.15 deprecation warnings for QString::SkipEmptyPartsChristian Kandeler2020-06-161-1/+2
| | | | | | Task-number: QTCREATORBUG-24098 Change-Id: I03ee6811df4346754bbd652f2c3c97477f9cdb7e Reviewed-by: hjk <hjk@qt.io>
* CompilationDbProjectManager: Do not remove -fpic from command linesChristian Kandeler2020-05-291-3/+1
| | | | | | | | | | This flag is needed by the code model. The test case that had it on the command line was invalid (clang does not allow -fPIC with win32 targets). Fixes: QTCREATORBUG-24106 Change-Id: Ic95c82c2090ef5ee1a11d01d7e4387a5c80cda3c Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
* CompilationDatabaseProjectManager: Fix file classification errorChristian Kandeler2019-12-061-1/+1
| | | | | | Fixes: QTCREATORBUG-23143 Change-Id: I670a7858070fd8c0d62b872b22f9605cc6a3b329 Reviewed-by: hjk <hjk@qt.io>
* CompilationDbManager: Add support for the "/imsvc" optionChristian Kandeler2019-10-291-10/+17
| | | | | | Fixes: QTCREATORBUG-23146 Change-Id: I024597d67e48595472b398ed40858bee17c1c4b9 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CompilationDBProjectManager: Handle relative sysrootChristian Kandeler2019-06-041-1/+1
| | | | | | Fixes: QTCREATORBUG-22388 Change-Id: I030b105897bd483c17aaf86229d4515b2dd747d3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CompilationDbProjectManager: Sanitize project parsingChristian Kandeler2019-05-231-0/+2
| | | | | | | | | | The parsing code used to access all kinds of stuff (e.g. the project tree and the toolchain manager) from the non-UI thread, which is not allowed. Fixes: QTCREATORBUG-22420 Change-Id: I4be47919d7e543376d31826dd380f66f4e060458 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CompilationDatabase: Asjust the sysroot and target handlingIvan Donchevskii2019-04-301-1/+8
| | | | | | | | | | | | | | If the sysroot option is found - set it as a kit sysroot (only in CompilationDatabase project where we have a cloned kit which does not affect the other existing kits). In other cases use the backup for the sysroot from the toolchain (can exist for clang toolchains based on mingw). Provide target when searching builtin include paths for clang. Fixes: QTCREATORBUG-22339 Change-Id: Ibe07c2e490ba4f7e0d259e6df698d641dbfd0298 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CompilationDatabase: Properly detect relative pathsIvan Donchevskii2019-04-261-3/+1
| | | | | | Fixes: QTCREATORBUG-22338 Change-Id: I0fcbd952d3aca4dfd8e56eb00e6a27bd1f1c51fe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CompilationDatabase: Force QString implicit sharingIvan Donchevskii2019-04-161-6/+14
| | | | | | | | | Most of the flags in compilation database are the same, let's share them by inserting them all into the temporary QSet of QString-s. Change-Id: I7d9b410b4b0bee40247434b49371bd37214d4c59 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CompilationDatabase: Speed up parsing project fileIvan Donchevskii2018-11-071-12/+17
| | | | | | | | Avoid expensive indexOf and check for the exactly same flags before applying the full filter. Change-Id: I6936b2022a2b439aad7bf0a65280c3db16d00c34 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* CompilationDatabase: Fix command line parsingIvan Donchevskii2018-11-021-3/+12
| | | | | | | | | Handle cased when -x{kind} is one option. Skip -o output files. Task-number: QTCREATORBUG-18402 Change-Id: Id8a8612bed2db2b35f17b0968a4ff529e7a66194 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CompilationDatabase: Support both code modelsIvan Donchevskii2018-11-011-0/+216
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>