From 1424b2037ea52096b258ca83ef318de744ff68e0 Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Thu, 15 Feb 2018 00:01:28 +0300 Subject: [PATCH] Trying to add AppleTvOs support GitOrigin-RevId: 923552a936613d5e30361bb354709337e8b0a990 --- CMake/iOS.cmake | 21 +++++++++++++++++++++ example/ios/build.sh | 5 ++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CMake/iOS.cmake b/CMake/iOS.cmake index 238379b4..9b395a07 100644 --- a/CMake/iOS.cmake +++ b/CMake/iOS.cmake @@ -93,6 +93,23 @@ elseif (${IOS_PLATFORM} STREQUAL "WATCHSIMULATOR") set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-watchsimulator") set (APPLE_WATCH True) +elseif (${IOS_PLATFORM} STREQUAL "TVOS") + set (IOS_PLATFORM_LOCATION "AppleTvOS.platform") + set (XCODE_IOS_PLATFORM tvos) + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-appletvos") + + set (APPLE_TV True) +elseif (${IOS_PLATFORM} STREQUAL "TVSIMULATOR") + set (SIMULATOR_FLAG true) + set (IOS_PLATFORM_LOCATION "AppleTvSimulator.platform") + set (XCODE_IOS_PLATFORM tvsimulator) + + # This causes the installers to properly locate the output libraries + set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-tvsimulator") + + set (APPLE_TV True) else (${IOS_PLATFORM} STREQUAL "OS") message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS, SIMULATOR, or WATCHOS.") endif () @@ -183,6 +200,10 @@ elseif (IOS_PLATFORM STREQUAL "WATCHOS") set (IOS_ARCH "armv7k") elseif (IOS_PLATFORM STREQUAL "WATCHSIMULATOR") set (IOS_ARCH "i386") +elseif (IOS_PLATFORM STREQUAL "TVOS") + set (IOS_ARCH "arm64") +elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR") + set (IOS_ARCH "x86_64") else() message (WARNING "Unknown IOS_PLATFORM=<${IOS_PLATFORM}>") endif() diff --git a/example/ios/build.sh b/example/ios/build.sh index eae6947a..0843bcd3 100755 --- a/example/ios/build.sh +++ b/example/ios/build.sh @@ -5,7 +5,7 @@ rm -rf build mkdir -p build cd build -platforms="macOS iOS watchOS" +platforms="macOS iOS watchOS tvOS" for platform in $platforms; do echo "Platform = ${platform} Simulator = ${simulator}" @@ -46,6 +46,9 @@ do if [[ $platform = "watchOS" ]]; then ios_platform="WATCH${ios_platform}" fi + if [[ $platform = "tvOS" ]]; then + ios_platform="TV${ios_platform}" + fi echo $ios_platform rm -rf $build mkdir -p $build