From fff97cda3bace16af52335a4856ea7acd95d70b7 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 14 Apr 2021 13:09:21 -0700 Subject: [PATCH 1/2] 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() From 7609248c49e947a79fb3f391481109dde8935b07 Mon Sep 17 00:00:00 2001 From: amzn-sj Date: Wed, 14 Apr 2021 15:42:24 -0700 Subject: [PATCH 2/2] Fix build errors --- ..._iOS.mm => O3DEApplicationDelegate_iOS.mm} | 20 +++++++++---------- ...lication_iOS.mm => O3DEApplication_iOS.mm} | 8 ++++---- .../Platform/iOS/platform_ios_files.cmake | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) rename Code/LauncherUnified/Platform/iOS/{LumberyardApplicationDelegate_iOS.mm => O3DEApplicationDelegate_iOS.mm} (86%) rename Code/LauncherUnified/Platform/iOS/{LumberyardApplication_iOS.mm => O3DEApplication_iOS.mm} (92%) diff --git a/Code/LauncherUnified/Platform/iOS/LumberyardApplicationDelegate_iOS.mm b/Code/LauncherUnified/Platform/iOS/O3DEApplicationDelegate_iOS.mm similarity index 86% rename from Code/LauncherUnified/Platform/iOS/LumberyardApplicationDelegate_iOS.mm rename to Code/LauncherUnified/Platform/iOS/O3DEApplicationDelegate_iOS.mm index fc589a4780..ca7ab2def0 100644 --- a/Code/LauncherUnified/Platform/iOS/LumberyardApplicationDelegate_iOS.mm +++ b/Code/LauncherUnified/Platform/iOS/O3DEApplicationDelegate_iOS.mm @@ -39,15 +39,15 @@ namespace } -@interface LumberyardApplicationDelegate_iOS : NSObject +@interface O3DEApplicationDelegate_iOS : NSObject { } -@end // LumberyardApplicationDelegate_iOS Interface +@end // O3DEApplicationDelegate_iOS Interface -@implementation LumberyardApplicationDelegate_iOS +@implementation O3DEApplicationDelegate_iOS -- (int)runLumberyardApplication +- (int)runO3DEApplication { #if AZ_TESTS_ENABLED @@ -55,7 +55,7 @@ namespace return static_cast(ReturnCode::ErrUnitTestNotSupported); #else - using namespace LumberyardLauncher; + using namespace O3DELauncher; PlatformMainInfo mainInfo; mainInfo.m_updateResourceLimits = IncreaseResourceLimits; @@ -79,19 +79,19 @@ namespace #endif // AZ_TESTS_ENABLED } -- (void)launchLumberyardApplication +- (void)launchO3DEApplication { - const int exitCode = [self runLumberyardApplication]; + const int exitCode = [self runO3DEApplication]; exit(exitCode); } - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - // prevent the lumberyard runtime from running when launched in a xctest environment, otherwise the + // prevent the o3de runtime from running when launched in a xctest environment, otherwise the // testing framework will kill the "app" due to the lengthy bootstrap process if ([[NSProcessInfo processInfo] environment][@"XCTestConfigurationFilePath"] == nil) { - [self performSelector:@selector(launchLumberyardApplication) withObject:nil afterDelay:0.0]; + [self performSelector:@selector(launchO3DEApplication) withObject:nil afterDelay:0.0]; } return YES; } @@ -132,4 +132,4 @@ namespace &AzFramework::IosLifecycleEvents::Bus::Events::OnDidReceiveMemoryWarning); } -@end // LumberyardApplicationDelegate_iOS Implementation +@end // O3DEApplicationDelegate_iOS Implementation diff --git a/Code/LauncherUnified/Platform/iOS/LumberyardApplication_iOS.mm b/Code/LauncherUnified/Platform/iOS/O3DEApplication_iOS.mm similarity index 92% rename from Code/LauncherUnified/Platform/iOS/LumberyardApplication_iOS.mm rename to Code/LauncherUnified/Platform/iOS/O3DEApplication_iOS.mm index f2fa9498d5..c76c2f69ab 100644 --- a/Code/LauncherUnified/Platform/iOS/LumberyardApplication_iOS.mm +++ b/Code/LauncherUnified/Platform/iOS/O3DEApplication_iOS.mm @@ -16,12 +16,12 @@ #include -@interface LumberyardApplication_iOS : UIApplication +@interface O3DEApplication_iOS : UIApplication { } -@end // LumberyardApplication_iOS Interface +@end // O3DEApplication_iOS Interface -@implementation LumberyardApplication_iOS +@implementation O3DEApplication_iOS - (void)touchesBegan: (NSSet*)touches withEvent: (UIEvent*)event { @@ -65,4 +65,4 @@ [self touchesEnded: touches withEvent: event]; } -@end // LumberyardApplication_iOS Implementation +@end // O3DEApplication_iOS Implementation diff --git a/Code/LauncherUnified/Platform/iOS/platform_ios_files.cmake b/Code/LauncherUnified/Platform/iOS/platform_ios_files.cmake index c1a642481f..d5711ed04c 100644 --- a/Code/LauncherUnified/Platform/iOS/platform_ios_files.cmake +++ b/Code/LauncherUnified/Platform/iOS/platform_ios_files.cmake @@ -13,8 +13,8 @@ set(FILES Launcher_iOS.mm Launcher_Traits_iOS.h Launcher_Traits_Platform.h - LumberyardApplication_iOS.mm - LumberyardApplicationDelegate_iOS.mm + O3DEApplication_iOS.mm + O3DEApplicationDelegate_iOS.mm ../Common/Apple/Launcher_Apple.mm ../Common/Apple/Launcher_Apple.h ../Common/UnixLike/Launcher_UnixLike.cpp