From fff97cda3bace16af52335a4856ea7acd95d70b7 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 14 Apr 2021 13:09:21 -0700 Subject: [PATCH] Cache runtime dependencies for targets to speed up iOS configuration. --- cmake/Platform/iOS/RuntimeDependencies_ios.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/Platform/iOS/RuntimeDependencies_ios.cmake b/cmake/Platform/iOS/RuntimeDependencies_ios.cmake index 37c1d6d976..d558c6f12a 100644 --- a/cmake/Platform/iOS/RuntimeDependencies_ios.cmake +++ b/cmake/Platform/iOS/RuntimeDependencies_ios.cmake @@ -28,6 +28,17 @@ function(ios_get_dependencies_recursive ios_DEPENDENCIES ly_TARGET) return() # Nothing to do endif() + # See if we already have dependencies cached. + get_property(are_dependencies_cached GLOBAL PROPERTY LY_RUNTIME_DEPENDENCIES_${ly_TARGET} SET) + if(are_dependencies_cached) + + # We already walked through this target + get_property(cached_dependencies GLOBAL PROPERTY LY_RUNTIME_DEPENDENCIES_${ly_TARGET}) + set(${ios_DEPENDENCIES} ${cached_dependencies} PARENT_SCOPE) + return() + + endif() + # Collect all direct dependencies. unset(direct_dependencies) unset(dependencies) @@ -102,6 +113,7 @@ function(ios_get_dependencies_recursive ios_DEPENDENCIES ly_TARGET) # Remove duplicate dependencies and return. list(REMOVE_DUPLICATES all_dependencies) + set_property(GLOBAL PROPERTY LY_RUNTIME_DEPENDENCIES_${ly_TARGET} "${all_dependencies}") set(${ios_DEPENDENCIES} ${all_dependencies} PARENT_SCOPE) endfunction()