Commit Graph

304 Commits

Author SHA1 Message Date
Tobias Hunger
db4b145536 Qmake: Suppress spurious warnings about compiler mismatch on Apple
Suppress spurious warnings about compiler mismatches on Apple all the time
at the cost of potentially supressing some real issues.

Task-number: QTCREATORBUG-17794
Change-Id: I7bef3b8065de676d625905f3bf9936c91094b04f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-17 08:22:34 +00:00
Tobias Hunger
18537a5594 ProjectNodes: Sprinkle QTC_ASSERT over code looking at parentFolderNode
Not checking the parentFolderNode triggered a crash elsewhere already, so
double check other uses of parentFolderNode and use QTC_ASSERT to make sure
no nullptr is going to be accessed.

This is necessary now that we have a forest of project trees and no longer
have a sessionnode anymore.

Change-Id: Ibc380c2ec9b12b983e709d2eeb03a8b741fe1058
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-05-12 10:33:15 +00:00
Tobias Hunger
ec0ff0cf7c qmake: Make resource file contents available again
The Qml code model needs the contents of resource files. This was done using
QmakeVfs::readVirtualFile, which is not correct, since it does not read data
from files on disk. So fix this mistake by using QmakeVfs::readFile instead.

Task-number: QTCREATORBUG-18140
Change-Id: I25fd07d63ab02764bdf3fa705e2ff025d6831581
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-05-05 12:06:26 +00:00
Kari Oikarinen
8c86400329 Qmake: Fix deploying versioned shared library symlinks
If in a .pro file VERSION is set with less than three version
components, for example "1.0", qmake on Linux still creates the .so with
the following links to it:

- libexample.so
- libexample.so.1
- libexample.so.1.0
- libexample.so.1.0.0

Creator only deployed first three of those.

Pad the version number with zeros to three components in order to find
all of them.

Change-Id: I0ca3b7cb9d2150e7e9a5c22a5522678aec085b95
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-10 06:00:47 +00:00
Tobias Hunger
0951589420 Project: Unify handling of displayName
Unify the handling of displayName with a proper changed signal across
all projects.

Change-Id: I7e503528854b85f6f38de4b0943775f82a0d6123
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-04-07 14:49:51 +00:00
Orgad Shaneh
e58c4ead93 QmakePM: Use a single constant for async update interval
Change-Id: Ifc8f466c615d90095cba0908ba40c43d74f7e053
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-05 13:45:23 +00:00
Christian Stenger
a59f209bb3 QmakePM: Fix executableFor() on macOS
Ensure that target is not empty and avoid storing a path instead of
the real executable.

Change-Id: I408a54befbbb7004773d04f4bdd3898469efbaa7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-03-30 10:41:04 +00:00
Tobias Hunger
b0c7bb0f7b Project: Move ProjectDocument setup into Project class
Change-Id: I5c0ec79ddf066e37660fb9a6b24f9d882355d511
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:53:24 +00:00
Tobias Hunger
348aa12eaa ProjectExplorer: Provide ProjectDocument and use it in all projects
Change-Id: I6e054ebf1043bd1f6748f1567f35c68394bd6528
Reviewed-by: hjk <hjk@qt.io>
2017-03-29 11:03:34 +00:00
Orgad Shaneh
ecacea18cb QmakePM: Fix toolchain executable comparison
Change-Id: I8fef9cb990be561cc822b33e772715895bbca6ca
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-28 13:58:44 +00:00
Tobias Hunger
fc5ce1e710 ProjectExplorer: Handle project file list globally
Handle the generation of the list of files in a project globally, based
on the project tree.

Creator now has the concept of TreeManagers which can enrich the project
tree with additional data (e.g. the files found in a resource file), which
the project does not necessarily know about. So use that tree to find
the files that belong to a project instead of implementing similar features
in each project.

Change-Id: Ia375a914a1f2c0adaa427f9eda834eec2db07f68
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-03-27 15:32:13 +00:00
Tobias Hunger
d5f242f3d6 Qmake: Do not warn when a compiler misses an .exe on windows
Task-number: QTCREATORBUG-17489
Change-Id: I8fbbf48b41b84adf8905d81ae21ded4ed2fd541d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-24 09:45:52 +00:00
Tobias Hunger
802eff3485 CppTools: Add target information to ProjectPart
This is important to be able to map sources to actual things that are
going to be built.

Change-Id: I1aef940767d60192642ed79a1703cff8dfdad9e1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-03-15 11:03:45 +00:00
Tobias Hunger
49fef0ae24 ProjectExplorer: Create initial project tree
Create an initial project tree with a ProjectNode and a FileNode for
the project file itself.

Fix the Projects to not implement their own tree before they have
better data.

Change-Id: I147ccd5603d22d1d60880a97f30fd8c271eac88c
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 16:22:31 +00:00
Tobias Hunger
2fde3fffa9 Make all projects generate a fresh project tree
Do not update the existing project tree anymore: Start a fresh one
and throw the old one away.

Change-Id: Ifabe293b6ca668b0672516a6d81acd5346d98fe5
Reviewed-by: hjk <hjk@qt.io>
2017-03-10 16:22:26 +00:00
Nikolai Kosjar
8a076e3f4b CppTools: De-duplicate and rename function in ProjectPart
Change-Id: I675ce4c9059d8ae4046f6a13aa7c04b88141d443
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 14:35:29 +00:00
hjk
c1bfc5d8ec ProjectExplorer: Follow up on too-much-magic in IProjectManager
Use a ProjectManager::registerProjectType<Project>(MimeType) function,
removing cryptic IProjectManager object ownership.

Change-Id: I212cd25bd4ee757022a8cb0decb4b8de3a112d12
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-09 10:41:33 +00:00
Tobias Hunger
270f863254 Qmake: Use QmakeProFile, not QmakeProFileNode
Change-Id: Ic156e25bcb797f8643639fb0606f2713830e83f6
Reviewed-by: hjk <hjk@qt.io>
2017-03-08 10:42:16 +00:00
hjk
d6df4492d0 ProjectExplorer: Use visitor-by-lambda for project tree
And inline it into user code. Less code in total and no intermediate
node lists.

Change-Id: I3724883408bfaa868266110aee27bbffd4d96bd8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-08 09:05:29 +00:00
Nikolai Kosjar
45b7c5ac29 Revert "CppTools: Do not put configuration document into global snapshot and working copy"
This reverts commit 05942b63f8 because it
breaks refactoring, e.g. Q_PROPERTY generators.

Change-Id: I9a14b912ba72663f08ea99e7e066d824b18da4b0
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-03-07 11:54:16 +00:00
hjk
be204a125e ProjectManager: Cut ties between Project and IProjectManager
Not needed, less code.

Change-Id: Ie0d5c3a60f0392f30ed2ee9d2c5a32156b4e67e1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-03-01 17:07:05 +00:00
Tobias Hunger
1ca7c150d0 Qmake: Clean up createProFileReader method of QmakeProject
Change-Id: I62c55afb8a3ea4dcbe3a8a1b4387d087bb71cdea
Reviewed-by: hjk <hjk@qt.io>
2017-03-01 14:47:41 +00:00
hjk
6fc03ac621 QMake: Simplify QmakeProject::creationIds use further
We always operate on specific types of proFiles, knowing the types
suffices as interface.

Change-Id: I5ffe8862ae31234843a71bdae537825b37ccd311
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 16:14:50 +00:00
hjk
4d3d2d0dfb ProjectExplorer: Remove Project manager parameter from some constructors
Can be done generically when creating projects. The only wart is
the use from BaseQmakeProjectWizardDialog::writeUserFile.

Change-Id: Ie98c9f88ec142e82443e204a0075e3ae9e163752
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-28 14:56:21 +00:00
hjk
b45c709dff QMake: Centralize determination of available creationIds
No need for each target to do essentially the same.

Change-Id: I76b6a0f2d064d7721f4ebe676f6efe12d3b5f87c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-02-28 12:19:11 +00:00
Tim Jenssen
2631ffabd5 Remove spaces in initializer lists
Format initializer lists code style like.

Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013
Reviewed-by: hjk <hjk@qt.io>
2017-02-22 16:25:09 +00:00
Tobias Hunger
f9eab73dad qmake: move over from QmakeProjectNodes to QmakeParserNodes
Change-Id: Iab87e0c248b0f651a1774336c3bddf83baa9d057
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 16:00:49 +00:00
Tobias Hunger
8f0697e33d qmake: Unify TargetInformation and TargetParserInformation again
Change-Id: I00fc6e99e55684e67e5240c539002b13f4541286
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:19:20 +00:00
Tobias Hunger
bc390a8e99 qmake: Do not use out-parameters for QmakeProject::findProFile
Change-Id: I9eec5138ebe0d3c02dadb91c66146e4419fc9cd3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-22 13:07:21 +00:00
Nikolai Kosjar
8c90998fff CppTools/ProjectManagers: Reduce ui blocking when loading projects
${AnyProject}::updateCppCodeModel() did two potentially not that cheap
operations in the ui thread:
 (1) Querying the MimeDatabase for the mime type for the source files of
     the project. In 99.9% of the cases no files need to be read for
     this as the file extension will resolve the type. The expensiveness
     comes from the sheer number of files that can occur.
 (2) Calling compilers with the "(sub)project's compiler command line"
     to determine the macros. While the caches avoid redundant calls,
     the number of the unique compiler calls makes this still a
     ui-freezing experience.

These two operations are moved into a worker thread. For this, the
expensive compiler calls are encapsulated in thread safe lambdas
("runners") in order to keep the "mutexed" data minimal. The original
API calls of the toolchains are implemented in terms of the runners.

While adapting the project managers, remove also the calls to
setProjectLanguage(). These are redundant because all of the project
managers already set a proper value in the constructor. Also, currently
there is no need (client) to report back detection of C sources in
project parts. This also keeps CppProjectUpdater simple.

There is still room for improvement:
 * Run the compiler calls in parallel instead of sequence.
 * Ensure that the mime type for a file is determined exactly once.

Change-Id: I2efc4e132ee88e3c8f264012ec8fafe3d86c404f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-02-20 09:18:13 +00:00
Tobias Hunger
2513116406 qmake: Fix WS
Change-Id: Ied361023444e21575504d2175c36fefd02e43752
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-17 12:51:38 +00:00
Tobias Hunger
69684d9f9c qmake: Rename QmakeParser*FileNode to Qmake*File
Change-Id: I7598ccf93ed21a6d6650db76b17d745a2739b18c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 11:02:04 +00:00
Tobias Hunger
528b5f2298 qmake: Use enums from Qmake*File over those in Qmake*FileNode
Use QmakeParserProFileNode::AsyncUpdateDelay instead of
QmakeParserProFileNode::AsyncUpdateDelay.

Change-Id: I6628e566ce0f289778d61d146df58ca31345cdd7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 09:02:52 +00:00
Tobias Hunger
b697fd0db4 qmake: Use Variable enum consistently
Change-Id: I89588f12600f0698de764c05c1930b13b53a2588
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:40:16 +00:00
Tobias Hunger
086733a2c9 qmake: Use ProjectType enum consistently
Change-Id: I633a7150202fcbf420a33b4173d2b4451f46eb11
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:40:11 +00:00
Tobias Hunger
0b6eb21388 QmakeProject: Fix CentralFolderWatcher
Make the loop actually iterate over something:-)

Change-Id: I9e7ff40c3e5c3860a99bca15e381c1e12eed4d51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-14 15:39:29 +00:00
Tobias Hunger
bfa456072c qmakeProject: Use nullptr
Change-Id: Idad0ace2ae264beff29864cb20cb1a7b67d16ac6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-14 14:39:43 +00:00
Tobias Hunger
e98f5ae226 QmakeProject: Remove some debugging code
Change-Id: Ia4266d568074023edfe40177e1e6a35186d935dd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-02-14 14:33:13 +00:00
hjk
95e2d7f545 ProjectExplorer: Remove ProjectNode::m_projectNodes
They are duplicated in m_folderNodes, use them.

Change-Id: I4571720f1ef3daf098870a3cf05fa28a1002bb3f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-08 11:15:55 +00:00
Tobias Hunger
b139b057a1 QmakeProject: Polish class
Use final, get rid of some useless headers and debug code

Change-Id: Icb1110f6eda4e17d143d8bdf17167d6c3046b884
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-31 15:28:17 +00:00
Ulf Hermann
c70b689526 Unify projectexplorer language IDs
We don't need two IDs for C++ and the QmlJS ID should look the same as
as the others.

Change-Id: Ib9747f6b36a90bb652951d85eec69666615670c4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-30 15:34:46 +00:00
Tobias Hunger
e8b4e180cd RunConfiguration: Introduce buildSystemTarget()
Introduce a method that maps a RunConfiguration to the build system target
that created the executable.

Implement the method in all RunConfigurations where that makes sense (e.g.
no CustomExecutables).

Change-Id: Ifaac859c2cd9b2806a0d7c185b2239312a67752a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-30 13:27:16 +00:00
Oswald Buddenhagen
8288ca1251 make more use of BaseQtVersion::qmakeProperty()
... instead of peeking into versionInfo().
in fact, make versionInfo() private, to avoid subsequent deterioration
as happened before (after 5e596e89d).
some other functions that use it in its interface also become private.

this fixes several breakages related to working with non-installed
prefix builds of qt.

Change-Id: Ib67de79323c9e38f3de48a09854b155de9eef5b2
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-01-24 14:01:06 +00:00
Filippo Cucchetto
4b1f8f3609 ProjectExplorer: Added support for registering custom languages
Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-23 11:19:11 +00:00
Tobias Hunger
25fbcca96b KitManager: Get rid of KitMatcher class
Use std::function instead. Clean up API while at it.

Change-Id: I6e401ab57f5375e36710c30508c596af3f4b3385
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-18 10:39:16 +00:00
Tobias Hunger
6553c3c99e BaseQtVersion: Allow for a predicate when retrieving Qt versions
Make methods used to retrieve Qt versions from the Qt versions manager
take a predicate to select the interesting version.

Change-Id: I9218c57bae6d5033d49d618dfc0da41fe578444d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-01-17 13:13:48 +00:00
Eike Ziller
b1f1ccb32e Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: I3484b668f9323ed0c05de99f8dfed07c9e65ab98
2017-01-11 09:29:37 +01:00
Orgad Shaneh
ffabc5dff1 QmakePM: Fix false positive warning for incompatible compiler
Some users set 'QMAKE_CXX = @echo $< && $$QMAKE_CXX' to prettify the
compiler output.

Another useful case for "incompatible" compiler is ccache, or other
compiler wrappers.

To eliminate warnings for these cases, pick the last value of QMAKE_CC/
QMAKE_CXX, excluding flags, and compare it against the configured toolchain.

Change-Id: Idc3b9377e6f7c39c09c50f36ec89460756510b97
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-04 09:26:29 +00:00
Nikolai Kosjar
0265442c93 QMakeProjectManager: Use ProjectPartBuilder
...as the other project managers.

This removes extra code paths, duplication and improves classification
of source files (ambiguous headers).

Change-Id: Iae05cbbc61ab2e5dd841ae617bec994e0a1e52d5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-13 14:55:36 +00:00
Nikolai Kosjar
602ad72d42 CppTools: Refactor ProjectPartBuilder
...and add some basic tests.

Introduce the abstractions ProjectInterface and ToolChainInterface in
order to break the dependency to the ProjectExplorer. Also, some simple
logic can go there to simplify the (Base)ProjectPartBuilder.

Change-Id: I6c50a1804ce62098b87109931eb171f5c2542937
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 08:33:04 +00:00