summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2018-11-08 22:29:55 +0100
committerTobias Hunger <tobias.hunger@qt.io>2018-11-22 15:20:59 +0000
commita2da0175cd29712a699edb1d4ab8a1d30e019821 (patch)
treee147d12b0d71e1851e08c4b4e91e263f609f2f49 /cmake
parent74e927855385d46d53ce13460d4d72ad605b1dae (diff)
CMake: Do less feature-pushing
Do not try to push features up into the parent scope if none were added. This avoids a lot of iterations over all defined variables. Change-Id: Idb9a4c86643c0ca773584a05b3a0590cfab7514d Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 0081f064ec..788d6d614b 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -440,6 +440,7 @@ function(extend_target target)
endforeach()
qt_internal_process_automatic_sources("${target}" "${_arg_SOURCES}")
+ set(must_push_features OFF)
foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES})
if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$")
if (${CMAKE_MATCH_COUNT} EQUAL 3)
@@ -458,6 +459,8 @@ function(extend_target target)
qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget})
endif()
qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget})
+
+ set(must_push_features ON)
endif()
endforeach()
@@ -468,9 +471,11 @@ function(extend_target target)
target_include_directories("${target}" PUBLIC ${_arg_PUBLIC_INCLUDE_DIRECTORIES} PRIVATE ${_arg_INCLUDE_DIRECTORIES})
target_compile_definitions("${target}" PUBLIC ${_arg_PUBLIC_DEFINES} PRIVATE ${_arg_DEFINES})
target_link_libraries("${target}" PUBLIC ${_arg_PUBLIC_LIBRARIES} PRIVATE ${_arg_LIBRARIES})
- endif()
- qt_push_features_into_parent_scope()
+ if(must_push_features)
+ qt_push_features_into_parent_scope()
+ endif()
+ endif()
endfunction()