From a2da0175cd29712a699edb1d4ab8a1d30e019821 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 8 Nov 2018 22:29:55 +0100 Subject: 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 Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'cmake') 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() -- cgit v1.2.3