diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build
index bed8c4e..772809e 100644
--- a/subprojects/gstreamer/meson.build
+++ b/subprojects/gstreamer/meson.build
@@ -435,8 +435,8 @@ if cc.has_header('execinfo.h')
   endif
 endif
 
 gst_debug = get_option('gst_debug')
-if not gst_debug
+if not gst_debug and cc.has_argument('-Wno-unused')
   add_project_arguments(['-Wno-unused'], language: 'c')
 endif
 
