Adding support for watchOS
authorMatthew Leibowitz <mattleibow@live.com>
Thu, 31 Aug 2017 01:38:31 +0000 (03:38 +0200)
committerMatthew Leibowitz <mattleibow@live.com>
Thu, 31 Aug 2017 01:38:31 +0000 (03:38 +0200)
gn/BUILD.gn
gn/BUILDCONFIG.gn
gn/core.gni
src/jumper/SkJumper.cpp

index ec7067c..86d1087 100644 (file)
@@ -33,7 +33,7 @@ declare_args() {
   malloc = ""
 
   enable_bitcode = false
-  if (is_tvos) {
+  if (is_tvos || is_watchos) {
     enable_bitcode = true
   }
 }
@@ -64,15 +64,16 @@ if (!is_clang && !is_win) {
 
 if (is_ios) {
   if (is_tvos) {
-    sdk = "appletvos"
-    if (target_cpu == "x86" || target_cpu == "x64") {
-      sdk = "appletvsimulator"
-    }
+    sdk = "appletv"
+  } else if (is_watchos) {
+    sdk = "watch"
   } else {
-    sdk = "iphoneos"
-    if (target_cpu == "x86" || target_cpu == "x64") {
-      sdk = "iphonesimulator"
-    }
+    sdk = "iphone"
+  }
+  if (target_cpu == "x86" || target_cpu == "x64") {
+    sdk += "simulator"
+  } else {
+    sdk += "os"
   }
   ios_sysroot = exec_script("find_ios_sysroot.py", [ sdk ], "trim string")
 }
@@ -219,6 +220,9 @@ config("default") {
     } else if (target_cpu == "x64") {
       _target = "x86_64"
     }
+    if (is_watchos && _target == "armv7") {
+      _target = "armv7k"
+    }
     asmflags += [
       "-isysroot",
       ios_sysroot,
index 49899db..334deb6 100644 (file)
@@ -37,8 +37,9 @@ if (current_os == "") {
 
 is_android = current_os == "android"
 is_fuchsia = current_os == "fuchsia"
-is_ios = current_os == "ios" || current_os == "tvos"
+is_ios = current_os == "ios" || current_os == "tvos" || current_os == "watchos"
 is_tvos = current_os == "tvos"
+is_watchos = current_os == "watchos"
 is_linux = current_os == "linux"
 is_mac = current_os == "mac"
 is_win = current_os == "win" || current_os == "winrt"
index a09e120..55d1112 100644 (file)
@@ -602,6 +602,6 @@ if (is_win) {
   if (target_cpu != "arm") {
     skia_core_sources += [ "$_src/jumper/SkJumper_generated_win.S" ]
   }
-} else if (!is_tvos) {
+} else if (!is_tvos && !is_watchos) {
   skia_core_sources += [ "$_src/jumper/SkJumper_generated.S" ]
 }
index 04d326a..960f8ed 100644 (file)
@@ -39,7 +39,7 @@ using StageFn = void(void);
 
 extern "C" {
 
-#if __has_feature(memory_sanitizer) || defined(SK_BUILD_FOR_TVOS)
+#if __has_feature(memory_sanitizer) || defined(SK_BUILD_FOR_TVOS) || defined(SK_BUILD_FOR_WATCHOS)
     // We'll just run portable code.
 
 #elif defined(__aarch64__)
@@ -115,7 +115,7 @@ static SkJumper_Engine gPlatform = kPortable;
 static SkOnce gChooseEngineOnce;
 
 static SkJumper_Engine choose_engine() {
-#if __has_feature(memory_sanitizer) || defined(SK_BUILD_FOR_TVOS)
+#if __has_feature(memory_sanitizer) || defined(SK_BUILD_FOR_TVOS) || defined(SK_BUILD_FOR_WATCHOS)
     // We'll just run portable code.
 
 #elif defined(__aarch64__)