summaryrefslogtreecommitdiff
path: root/src/plugins/compilationdatabaseprojectmanager
Commit message (Collapse)AuthorAgeFilesLines
* CompilationDBProjectManager: Handle relative sysrootChristian Kandeler2019-06-041-1/+1
| | | | | | Fixes: QTCREATORBUG-22388 Change-Id: I030b105897bd483c17aaf86229d4515b2dd747d3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-285-33/+33
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* ExtensionSystem: Move away from QListEike Ziller2019-05-272-3/+3
| | | | | | | | Qt 6 API will move away from it. Use QVector for API and some std container for internal things. Change-Id: Iff14d48a47d5ac52ade875d9c8c84ad8a4f577d8 Reviewed-by: hjk <hjk@qt.io>
* CMake build: Add new files in compilation database pluginEike Ziller2019-05-231-0/+1
| | | | | | Change-Id: I4d83d77e70a99d8e9fb76e09fa95a70f24e4162f Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CompilationDbProjectmanager: Fix build for older compilersChristian Kandeler2019-05-231-2/+2
| | | | | Change-Id: Ie84e5d06b672a335c68528fb1acf4b7492d998cd Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CMake build: Add ability to disable building of individual pluginsEike Ziller2019-05-231-5/+4
| | | | | | | | | | | | | | Adds a cache entry "BUILD_PLUGIN_${NAME}", defaulting to ON which can be set to OFF to disable building of a plugin. Adds a extend_qtc_plugin function that should be used to add properties to a plugin after add_qtc_plugin, instead of the standard CMake functions target_... . The new function results in a no-op if the plugin was disabled. Change-Id: I57f6799620aea0aaa8b56acead4815ccced95911 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* CompilationDbProjectManager: Sanitize project parsingChristian Kandeler2019-05-238-180/+383
| | | | | | | | | | 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>
* Utils: Make FileName::canonicalPath a memberhjk2019-05-201-4/+2
| | | | | Change-Id: I8d7450dec5c4c14ae3e007d1d66f1a9c3c98f807 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Qt Creator CMake portCristian Adam2019-05-171-0/+16
| | | | | | | | | | | | | | Based on Tobias Hunger's work from a few months ago. The CMake configuration needs libclang and Qt paths specified as CMAKE_PREFIX_PATH. Auto tests are run with "ctest". At the moment the pass rate is 87%. Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* More FileName::appendPath() -> .pathAppended()hjk2019-05-171-6/+3
| | | | | Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Some more FileName::appendPath() -> pathAppended() changeshjk2019-05-171-2/+2
| | | | | Change-Id: Ie494f7ae8a96d97c9497b3ef38d774d2cf787b7f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ProjectExplorer: Remove BuildTargetInfoList wrapper classhjk2019-05-141-4/+1
| | | | | Change-Id: I1a2ae06ec8c5b7278abca2386834d7edd31597d7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CompilationDatabase: enable the listing of non-cpp filesThomas Otto2019-05-023-3/+56
| | | | | | | | | Files listed in an optional "compile_database.json.files" are also visible in the project, similar to the GenericProjectManager. Change-Id: I1250b674298079bab90a0ffe036107a09b4ac6e5 Reviewed-by: Thomas Otto <totto@zbh.uni-hamburg.de> Reviewed-by: hjk <hjk@qt.io>
* CompilationDatabase: Asjust the sysroot and target handlingIvan Donchevskii2019-04-303-22/+36
| | | | | | | | | | | | | | 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: Allow the second root nodeIvan Donchevskii2019-04-291-11/+31
| | | | | | | | The 'directory' field of a compilation database can be in many cases another root directory to look into. Change-Id: Ie0d11bdc706f09e4d466b20fef614dd6ce00d4e9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CompilationDatabase: Allow to set custom build step and run commandIvan Donchevskii2019-04-293-1/+93
| | | | | | | | | In addition export the ProcessStep class from ProjectExplorer not to duplicate the code. Task-number: QTCREATORBUG-21727 Change-Id: I43d0c83b0338995fdb37ace940092c83ce2b6820 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: Fix few bugs and plugin testsIvan Donchevskii2019-04-263-15/+37
| | | | | | | | | | | - do not convert the DOS path if it does not exist - pass the proper flags to addDriverModeFlagIfNeeded - reset the kit toolchain before picking the matching one - do not show the popup when running plugin tests - clang++ contains 'g++' but it's not a gcc compiler Change-Id: Ia5018a2131bb123202b87e34e0ac3a79f0feb45d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* RemoteLinux: Retrieve deployment info from local install rootChristian Kandeler2019-04-231-0/+1
| | | | | | | | | | | | | | | | This provides correct deployment information as seen by the build system when Qt Creator cannot retrieve it directly. It's most useful for autotools and cmake projects, but can also help with qmake in certain edge cases. [ChangeLog] It is no longer necessary to provide a QtCreatorDeployment.txt file when using CMake projects with remote Linux devices. Fixes: QTCREATORBUG-21855 Change-Id: I27e07a45dd1565e489f4b573cc3fff8191c57d9b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* CompilationDatabase: Force QString implicit sharingIvan Donchevskii2019-04-163-13/+24
| | | | | | | | | 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: Ask for the root path and scan for headersIvan Donchevskii2019-04-054-17/+138
| | | | | | | | | | | | | | | Let's use the same approach we have for CMake projects by using the same TreeScanner class. Compilation database does not have a concept of the root directory so let's show a file dialog and ask for it the first time the project is loaded. Next times we open it we take this path from settings. This root path can later be changed from the project tree context menu. Fixes: QTCREATORBUG-22031 Change-Id: I151aed8d0504b2e8aa14aa774cad25f8c86d5c17 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.9'Eike Ziller2019-03-212-7/+25
|\ | | | | | | Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
| * CompilationDatabase: Refresh the tree on the JSON file updateIvan Donchevskii2019-03-152-7/+25
| | | | | | | | | | | | | | | | | | Reparse the compile_commands.json file when it has changed. Fixes: QTCREATORBUG-21733 Change-Id: I8e5a99efd136b1d46a417817bde5b5b989109eea Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* | ProjectExplorer: Un-protect ProjectNode constructorhjk2019-02-261-8/+1
| | | | | | | | | | | | | | | | Not much protection needed, and not provided either, as seen in the removed workarounds. Change-Id: Ib33f6481cdb04481c0324bdeb57eb50143ecb62f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Use a setter for the Node's typehjk2019-02-261-2/+1
| | | | | | | | | | Change-Id: I3cc496151888cdecff0be54043a24fefe5ee2b02 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Replace FolderNode ctor display argumenthjk2019-02-261-1/+2
| | | | | | | | | | | | | | ... by use of the setter. Change-Id: Ie6bf15b4dfae4d4e4d98694313b6e7dc9a22c117 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | ProjectExplorer: Remove FileNode's isGenerated constructor boolhjk2019-02-251-6/+2
| | | | | | | | | | | | | | Use setter of base class, similar to setListInProject() before. Change-Id: Id620f0084a5dec0410f29c80f8f6393a6bcd5050 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | ProjectExplorer: Rename KitInformation to KitAspectChristian Kandeler2019-02-111-4/+4
|/ | | | | | | | | | | The name "KitInformation" does not properly convey the fact that it represents a certain *aspect* of a kit. The same goes for "KitConfigWidget", which in addition was inconsistent with "KitInformation". We now use "KitAspect" and "KitAspectWidget". Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97 Reviewed-by: hjk <hjk@qt.io>
* CppTools: Simplify ProjectUpdateInfoNikolai Kosjar2019-01-101-5/+6
| | | | | | | ...by using KitInfo. Change-Id: I17b4dd6c368ba8b10b765f12a4663c041c9be7e5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppProjectUpdater: Remove unread attributeBernhard Beschow2019-01-061-1/+1
| | | | | | Change-Id: I51123e5b5609de431cfa6d1558aed0b9739ff9c8 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CompilationDatabase: Fix directory hierarchyMichael Weghorn2018-12-191-10/+5
| | | | | | | | | | | | | | | | | | | | When checking whether a child directory already exists, only check whether that directory is present as a direct child of the given parent, don't search recursively. Otherwise the directory hierarchy in the project outline can get messed up if multiple directories with the same name exist at different levels in the folder hierarchy. Side note: Besides avoiding an incorrect folder hierarchy, avoiding the recursive search also speeds up building up the folder structure (e.g. it took ~4 instead of ~20 seconds for building up the hierarchy of the LibreOffice source tree in my case). Fixes: QTCREATORBUG-21725 Change-Id: I5fc3c5c85d44ad8e3664f29e9143fc070d488c7a Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CompilationDatabase: Don't translate qWarningRobert Loehning2018-11-141-2/+1
| | | | | | | Change-Id: I5d7507fd05312e2d9b7ea57c94744aa311dc1104 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* CompilationDatabase: Speed up parsing project fileIvan Donchevskii2018-11-073-50/+79
| | | | | | | | 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: Use QJsonDocument for separate objectsIvan Donchevskii2018-11-051-6/+31
| | | | | | | | | | It is pretty easy to split objects without QJsonDocument help. Due to the QJsonObject data size restriction use it only for the already split objects inside the database. Change-Id: Ice7c7407ad00aaac151a767f4d943fdcecf6a6b8 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CompilationDatabase: Add folders to Project viewIvan Donchevskii2018-11-051-27/+85
| | | | | Change-Id: I4cd480535c203aa923b27596ea4ca74f83c12a9e Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* CompilationDatabase: Fix command line parsingIvan Donchevskii2018-11-022-4/+13
| | | | | | | | | 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: Create target in the same threadIvan Donchevskii2018-11-021-2/+3
| | | | | | | | Causes a warning otherwise. Change-Id: I040c3298e7c0898364b49ff4c6605f11f01c538f Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CompilationDatabase: Add target to the compilation database projectIvan Donchevskii2018-11-021-0/+3
| | | | | | | | 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>
* CompilationDatabase: Support both code modelsIvan Donchevskii2018-11-0114-178/+790
| | | | | | | | | 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>
* CompilationDatabase: Fix escaped quotes handlingIvan Donchevskii2018-11-011-2/+4
| | | | | Change-Id: Iaecd38f921bd719899e478a76d8a8b9d4230a7cc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CompilationDatabase: Fix opening relative file pathsIvan Donchevskii2018-10-291-7/+13
| | | | | | | Change-Id: I0d0ac8af9cd48510b8b8a80adfb20b8c526cd2e4 Fixes: QTCREATORBUG-21386 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Toolchains: Detect unspecified language versionNikolai Kosjar2018-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* Add qbs files for CompilationDatabaseProjectManagerNikolai Kosjar2018-10-081-0/+19
| | | | | | Change-Id: I892abbb7c389e2e075b1637a386e0d089a533d9e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* fix dependenciesTim Jenssen2018-09-201-3/+2
| | | | | Change-Id: Ie1e9c9312ef5a8aa37816d9dedddb41c839f3580 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Plugins: Add compilation database pluginIvan Donchevskii2018-09-198-0/+550
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>