Fix heapprofd out-of-tree build for SDK 30

Change-Id: If9a793cb3e1f0588c98d6f651c2ed87ec550a811
diff --git a/BUILD.gn b/BUILD.gn
index bb4fe63..6f6cc7d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -46,10 +46,11 @@
 }
 
 if (enable_perfetto_heapprofd) {
-  all_targets += [
-    "src/profiling/memory:heapprofd",
-    "src/profiling/memory:heapprofd_glibc_preload",
-  ]
+  all_targets += [ "src/profiling/memory:heapprofd" ]
+
+  if (is_linux && !is_android) {
+    all_targets += [ "src/profiling/memory:heapprofd_glibc_preload" ]
+  }
   if (perfetto_build_with_android) {
     all_targets += [
       "src/profiling/memory:heapprofd_client",