From dfcade8a298274d28963329df7d9dea155a875c3 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 18 Feb 2022 15:18:09 -0500 Subject: [PATCH] Move even more common iOS/tvOS files --- platforms/ios/AppDelegate.h | 7 ---- platforms/ios/AppDelegate.m | 37 -------------------- platforms/ios/CMakeLists.txt | 19 +++------- platforms/ios/main.m | 11 ------ platforms/ios/plist.in | 66 ----------------------------------- platforms/tvos/AppDelegate.h | 7 ---- platforms/tvos/AppDelegate.m | 37 -------------------- platforms/tvos/CMakeLists.txt | 8 ++--- platforms/tvos/main.m | 11 ------ platforms/tvos/plist.in | 64 --------------------------------- 10 files changed, 9 insertions(+), 258 deletions(-) delete mode 100644 platforms/ios/AppDelegate.h delete mode 100644 platforms/ios/AppDelegate.m delete mode 100644 platforms/ios/main.m delete mode 100644 platforms/ios/plist.in delete mode 100644 platforms/tvos/AppDelegate.h delete mode 100644 platforms/tvos/AppDelegate.m delete mode 100644 platforms/tvos/main.m delete mode 100644 platforms/tvos/plist.in diff --git a/platforms/ios/AppDelegate.h b/platforms/ios/AppDelegate.h deleted file mode 100644 index 134c806..0000000 --- a/platforms/ios/AppDelegate.h +++ /dev/null @@ -1,7 +0,0 @@ -#import // UIApplicationDelegate - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end \ No newline at end of file diff --git a/platforms/ios/AppDelegate.m b/platforms/ios/AppDelegate.m deleted file mode 100644 index eac107e..0000000 --- a/platforms/ios/AppDelegate.m +++ /dev/null @@ -1,37 +0,0 @@ -#import "AppDelegate.h" - -@interface AppDelegate() - -@end - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Insert code here to initialize your application - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - - -@end diff --git a/platforms/ios/CMakeLists.txt b/platforms/ios/CMakeLists.txt index 8cca590..d3a037f 100644 --- a/platforms/ios/CMakeLists.txt +++ b/platforms/ios/CMakeLists.txt @@ -3,12 +3,12 @@ cmake_minimum_required (VERSION 3.7) include(BundleUtilities) set(APP_HEADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/AppDelegate.h + ${PROJECT_SOURCE_DIR}/platforms/uikit/AppDelegate.h ) set(APP_SOURCE_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/AppDelegate.m - ${CMAKE_CURRENT_SOURCE_DIR}/main.m + ${PROJECT_SOURCE_DIR}/platforms/uikit/AppDelegate.m + ${PROJECT_SOURCE_DIR}/platforms/uikit/main.m ) set(RESOURCES @@ -38,7 +38,7 @@ add_platform( ${APP_HEADER_FILES} ${APP_SOURCE_FILES} ${RESOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/../uikit/file.mm + ${PROJECT_SOURCE_DIR}/platforms/uikit/file.mm EXECUTABLE_PROPERTIES MACOSX_BUNDLE ON LINK_LIBRARIES @@ -79,11 +79,9 @@ function(add_platform_commands APP_NAME) set(MACOSX_BUNDLE_COPYRIGHT "Copyright lololol") set(MACOSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc") - set(IOS_DIRECTORY ${PROJECT_SOURCE_DIR}/platforms/ios) - configure_file(${IOS_DIRECTORY}/plist.in ${CMAKE_BINARY_DIR}/${add_platform_executable_TARGET}Info.plist) + configure_file(${PROJECT_SOURCE_DIR}/platforms/uikit/plist.in ${CMAKE_BINARY_DIR}/${add_platform_executable_TARGET}Info.plist) set(RESOURCES ${IOS_DIRECTORY}/Main.storyboard @@ -108,11 +106,4 @@ function(add_platform_commands APP_NAME) XCODE_ATTRIBUTE_ENABLE_TESTABILITY YES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES ) - - set_target_properties( - ${APP_NAME} - PROPERTIES - XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS - "@executable_path/Frameworks" - ) endfunction() diff --git a/platforms/ios/main.m b/platforms/ios/main.m deleted file mode 100644 index 9aa3af5..0000000 --- a/platforms/ios/main.m +++ /dev/null @@ -1,11 +0,0 @@ -// UIApplicationMain() - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} \ No newline at end of file diff --git a/platforms/ios/plist.in b/platforms/ios/plist.in deleted file mode 100644 index b1670f8..0000000 --- a/platforms/ios/plist.in +++ /dev/null @@ -1,66 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIBackgroundModes - - fetch - remote-notification - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - CADisableMinimumFrameDurationOnPhone - - - \ No newline at end of file diff --git a/platforms/tvos/AppDelegate.h b/platforms/tvos/AppDelegate.h deleted file mode 100644 index 134c806..0000000 --- a/platforms/tvos/AppDelegate.h +++ /dev/null @@ -1,7 +0,0 @@ -#import // UIApplicationDelegate - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end \ No newline at end of file diff --git a/platforms/tvos/AppDelegate.m b/platforms/tvos/AppDelegate.m deleted file mode 100644 index eac107e..0000000 --- a/platforms/tvos/AppDelegate.m +++ /dev/null @@ -1,37 +0,0 @@ -#import "AppDelegate.h" - -@interface AppDelegate() - -@end - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Insert code here to initialize your application - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - - -@end diff --git a/platforms/tvos/CMakeLists.txt b/platforms/tvos/CMakeLists.txt index 0f3f972..7643a16 100644 --- a/platforms/tvos/CMakeLists.txt +++ b/platforms/tvos/CMakeLists.txt @@ -3,12 +3,12 @@ cmake_minimum_required (VERSION 3.7) include(BundleUtilities) set(APP_HEADER_FILES - ${PROJECT_SOURCE_DIR}/platforms/tvos/AppDelegate.h + ${PROJECT_SOURCE_DIR}/platforms/uikit/AppDelegate.h ) set(APP_SOURCE_FILES - ${PROJECT_SOURCE_DIR}/platforms/tvos/AppDelegate.m - ${PROJECT_SOURCE_DIR}/platforms/tvos/main.m + ${PROJECT_SOURCE_DIR}/platforms/uikit/AppDelegate.m + ${PROJECT_SOURCE_DIR}/platforms/uikit/main.m ) set(RESOURCES @@ -81,7 +81,7 @@ function(add_platform_commands APP_NAME) set(MACOSX_BUNDLE_COPYRIGHT "Copyright YOU") set(MACOSX_DEPLOYMENT_TARGET ${DEPLOYMENT_TARGET}) - configure_file(${PROJECT_SOURCE_DIR}/platforms/tvos/plist.in ${CMAKE_BINARY_DIR}/${add_platform_executable_TARGET}Info.plist) + configure_file(${PROJECT_SOURCE_DIR}/platforms/uikit/plist.in ${CMAKE_BINARY_DIR}/${add_platform_executable_TARGET}Info.plist) set_target_properties(${APP_NAME} PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym" diff --git a/platforms/tvos/main.m b/platforms/tvos/main.m deleted file mode 100644 index 9aa3af5..0000000 --- a/platforms/tvos/main.m +++ /dev/null @@ -1,11 +0,0 @@ -// UIApplicationMain() - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} \ No newline at end of file diff --git a/platforms/tvos/plist.in b/platforms/tvos/plist.in deleted file mode 100644 index 1279a25..0000000 --- a/platforms/tvos/plist.in +++ /dev/null @@ -1,64 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIBackgroundModes - - fetch - remote-notification - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - - \ No newline at end of file