diff --git a/hw/xquartz/bundle/meson.build b/hw/xquartz/bundle/meson.build
index 1305ccf231a70da5c8f196ef1a848885a979c21f..22941203b80a297510c20cc197d85a3f70a868a7 100644
--- a/hw/xquartz/bundle/meson.build
+++ b/hw/xquartz/bundle/meson.build
@@ -10,11 +10,7 @@ cpp_defs = [
 ]
 
 if build_sparkle
-cpp_defs += [
-    '-DXQUARTZ_SPARKLE',
-    '-DXQUARTZ_SPARKLE_FEED_URL=@0@'.format(xquartz_sparkle_feed_url),
-    '-DXQUARTZ_SPARKLE_PUBLIC_EDKEY=@0@'.format(xquartz_sparkle_public_edkey),
-]
+cpp_defs += sparkle_defs
 endif
 
 # bundle data
diff --git a/hw/xquartz/meson.build b/hw/xquartz/meson.build
index b0c7a386ec477cbe1047d2298dc51ac1216e6c02..05600fdd99dde4c19706c2763342a969433bd192 100644
--- a/hw/xquartz/meson.build
+++ b/hw/xquartz/meson.build
@@ -28,6 +28,14 @@ bundle_root = join_paths(apple_applications_dir, apple_application_name + '.app'
 build_sparkle = xquartz_sparkle_feed_url != '' and xquartz_sparkle_public_edkey != ''
 if build_sparkle
     sparkle = dependency('Sparkle', method: 'extraframework')
+
+    sparkle_defs = [
+        '-DXQUARTZ_SPARKLE',
+        '-DXQUARTZ_SPARKLE_FEED_URL=@0@'.format(xquartz_sparkle_feed_url),
+        '-DXQUARTZ_SPARKLE_PUBLIC_EDKEY=@0@'.format(xquartz_sparkle_public_edkey),
+    ]
+else
+    sparkle_defs = []
 endif
 
 # libxquartz
@@ -56,6 +64,7 @@ libxquartz_defs = [
     '-DXQUARTZ',
     '-DXSERVER_VERSION="@0@"'.format(meson.project_version()),
     bundle_id_def,
+    sparkle_defs,
 ]
 
 if cc.has_function('dispatch_async')