Commit Graph

12 Commits

Author SHA1 Message Date
Kai Koehne
d072975076 Mark 'CMake Topological Sort' attribution as tools related
The code is only used for building Qt, and not shipped by customers.

Change-Id: I0e255fe674b1703160608ab6b208918ea511baa4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 478c779baf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 15:38:15 +00:00
Volker Hilsheimer
a5d236688f Add worktrees as detached
Since we later check the worktree out to the revision specified
in the dependency file, add it as detached to avoid conflicts
with already existing worktrees for the default branch.

As a drive-bye, fix a typo in a comment.

Change-Id: I81c30c1fa3cfc9831fe7884a103746b43478dd8e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5bbec95c48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 11:17:07 +00:00
Volker Hilsheimer
034a1967a6 Initialize missing submodules if a supermodule is present
When fetching dependencies, the submodule directory might not exist
or might be empty. If so, try to initialize the submodule before trying
to add the worktree.

Change-Id: Ie4d6ec483ac9ea3f9207d5ab4cea34d6e0fb2921
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 21fea13125)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 11:17:07 +00:00
Volker Hilsheimer
367b81813b Support absorbed and unabsorbed submodules
Modern git usage for submodules is that the git object storage is absorbed
into the supermodule (see git submodule absorbgitdirs).

Handle both cases when trying to locate the gitdir for the target module.

Change-Id: Icddbae3a4d9a8823551106f089dbbff2c935ff35
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b6dfb5e295)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 20:47:18 +00:00
Volker Hilsheimer
8ea1c6ba02 Be less quiet when cloning or adding worktrees
Since doing either for qtbase and qtdeclarative can take a long time,
and since it's a relevant change to the local file system, log what's
going on.

Swallow output from most git commands unless cmake runs in VERBOSE
mode.

Change-Id: I984915689247d6372240744b5bc9183660046084
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 302548040c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 04:42:54 +00:00
Volker Hilsheimer
c47432eda3 Make syncing script capable of setting up new worktrees and clones
For missing dependencies, create worktrees from existing clones if
found, otherwise clone from the same remote.

Change-Id: Ie624e6c1b3f621dce43ee8cc7f06ce469851285b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-17 16:40:45 +01:00
Volker Hilsheimer
f8b8a9a59f Add a script to synchronize the repo to a consistent (sub)set
Make a few modifications to the dependency evaluation to include the
revision of each dependency, and a method that checks each dependency
out to the revision necessary to create a consistent set for the
requested module.

If the requested module is ".", check all modules out to the given
revision.

Can be called (ideally from a git-sync-to alias script):

cmake -DSYNC_TO_MODULE="$1" -DSYNC_TO_BRANCH="$2" \
      -P cmake/QtSynchronizeRepo.cmake

Change-Id: I007e9f9023bae949907b64e264ae7869dff1da2e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-17 16:40:41 +01:00
Alexey Edelev
a2683113e2 CMake: Fix dependency handling when module is skipped
Put dependencies of all modules to top-level variables and
check for unmet dependencies before module configuring.

Fixes: QTBUG-88214
Change-Id: I089feb474687652f3f8fd1bb1959179ea1114983
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-14 13:10:30 +00:00
Volker Hilsheimer
da25b7f149 Use dependencies.yaml to order sub modules
Don't rely on .gitmodules, instead parse the dependencies.yaml file from
every subdirectory with a CMakeLists.txt, and sort all projects based
on that data. Projects with no dependencies are added last.

This allows us to get rid of the duplication of dependency information
in .gitmodules, and makes each module the authoritative source of its
own dependencies.

Change-Id: Ib1ec6c63bde2aa1852399d598dac5b8e1efda31d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-11 11:44:25 +01:00
Leander Beernaert
c5c56d2548 CMake: Add missing quote in qt_attribution.json
Change-Id: I360f5311373265843234c45bd8dd24f6499a5b99
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-31 11:30:05 +02:00
Leander Beernaert
0739a54a4b Read module list from .gitmodules
This patch mimics the behavior of qt.pro, where the module list is
extracted from the .gitmodules file and then topologically sorted
based on the modules dependencies.

This patch also introduces a small check to make sure all the required
dependencies are met and will be built.

Change-Id: Idd3df9b618805ca0b2347eac57aaa39c1bcdb3dd
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b01225fb32)
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-03-18 21:26:26 +01:00
Kevin Funk
a59826003e Start the CMake superbuild
Also import and use ECMOptionalAddSubdirectory.cmake to add other
module's as subdirectories, in case the directories exist. Additionally
this module allows to disable the build of submodules by passing e.g.
BUILD_qtsvg=OFF.

This probably needs more though on how to hande the intermodule dependencies,
but it's a start.

Task-number: QTBUG-75582
Change-Id: Ic3de9711d9b865b2d96bdaee0089f570408b9693
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 7509458d5f)
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-18 21:26:20 +01:00