Viewer on Mac.

  - Support ObjC / ObjC++
  - Build SDL on Mac.
  - Build viewer on Mac.

Patched from Jim's CL.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3760

Change-Id: I12663f2ed2969e22f51aefed560fbc22b2524167
Reviewed-on: https://skia-review.googlesource.com/3760
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 3b9a83a..a3b7857 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1182,7 +1182,7 @@
     testonly = true
   }
 
-  if (skia_enable_gpu && (is_linux || is_win)) {
+  if (skia_enable_gpu && (is_linux || is_win || is_mac)) {
     executable("viewer") {
       sources = [
         "tools/viewer/GMSlide.cpp",
@@ -1211,6 +1211,13 @@
           "tools/viewer/sk_app/win/Window_win.cpp",
           "tools/viewer/sk_app/win/main_win.cpp",
         ]
+      } else if (is_mac) {
+        sources += [
+          "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
+          "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
+          "tools/viewer/sk_app/mac/Window_mac.cpp",
+          "tools/viewer/sk_app/mac/main_mac.cpp",
+        ]
       }
 
       if (skia_use_vulkan) {
@@ -1234,6 +1241,9 @@
         ":views",
         "//third_party/jsoncpp",
       ]
+      if (is_mac) {
+        deps += [ "//third_party/libsdl" ]
+      }
       testonly = true
     }
   }