Enable AutoreleasePool for MacOS/iOS in general.

Dawn-Metal also needs an AutoreleasePool, and it's good practice
to have it running on these platforms in any case.

Change-Id: I03da4763f9204e1beed6849a4e342603268a3195
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/638026
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index 869da80..aff8ede 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2170,15 +2170,11 @@
     if (is_ios) {
       sources += [ "tools/ios_utils.m" ]
       sources += [ "tools/ios_utils.h" ]
-      if (skia_use_metal) {
-        sources += [ "tools/AutoreleasePool.mm" ]
-      }
+      sources += [ "tools/AutoreleasePool.mm" ]
       frameworks += [ "Foundation.framework" ]
     } else if (is_mac) {
-      if (skia_use_metal) {
-        sources += [ "tools/AutoreleasePool.mm" ]
-        frameworks += [ "Foundation.framework" ]
-      }
+      sources += [ "tools/AutoreleasePool.mm" ]
+      frameworks += [ "Foundation.framework" ]
     } else if (is_win && !skia_enable_winuwp) {
       libs += [ "DbgHelp.lib" ]
     }
diff --git a/tools/AutoreleasePool.h b/tools/AutoreleasePool.h
index 0582404..50e9790 100644
--- a/tools/AutoreleasePool.h
+++ b/tools/AutoreleasePool.h
@@ -12,7 +12,7 @@
  * Helper class for managing an autorelease pool for Metal. On other platforms this will
  * do nothing so there's no need to #ifdef it out.
  */
-#ifdef SK_METAL
+#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
 class AutoreleasePool {
 public:
     AutoreleasePool();