diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-01-17 17:14:19 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-01-23 11:53:01 +0000 |
commit | 6e9a2dd3c6994d83f1a24dadba0ecc1350e441dd (patch) | |
tree | fc9f2c4228cdfdeed5f20eb4e3313ccf590813dc /util | |
parent | 3f3517923e979a06cb01e999a7be12d32a14e2b2 (diff) |
CMake: pro2cmake.py: Visit scopes depth-first for include resolution
This avoids some includes being done several times: We used to generate
scopes for the include files, add them to our current scope and then
traverse the children of the current scope.
Switch the order to avoid traversing the newly added scopes twice.
Change-Id: Icb9c53c9f54772d3305e0fb121824c23d5469e09
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'util')
-rwxr-xr-x | util/cmake/pro2cmake.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index d99863cbcc..e37c765f7a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -884,6 +884,9 @@ def generate_cmakelists(scope: Scope) -> None: def do_include(scope: Scope, *, debug: bool = False) -> None: + for c in scope.children(): + do_include(c) + for i in scope.getIncludes(): dir = scope.basedir() include_file = i @@ -906,9 +909,6 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: scope.merge(include_scope) - for c in scope.children(): - do_include(c) - def main() -> None: args = _parse_commandline() |