meson: simplify GST_DISABLE_GST_DEBUG check and don't use add_global_*

add_global_arguments() can't be used in subprojects. It's
entirely possible that devtools is a subproject but gstreamer
is picked up from an installed location, so we should
really use add_project_arguments() in both cases.
This commit is contained in:
Tim-Philipp Müller 2018-02-21 19:50:33 +00:00
parent 9fdfb2d7b7
commit d8f7969e41

View file

@ -97,27 +97,15 @@ gnome = import('gnome')
gtkdoc = find_program('gtkdoc-scan', required : false) gtkdoc = find_program('gtkdoc-scan', required : false)
if gst_dep.type_name() == 'internal' if gst_dep.type_name() == 'internal'
gst_proj = subproject('gstreamer') gst_debug_disabled = subproject('gstreamer').get_variable('disable_gst_debug')
if gst_proj.get_variable('disable_gst_debug')
message('GStreamer debug system is disabled')
add_project_arguments('-Wno-unused', language: 'c')
else
message('GStreamer debug system is enabled')
endif
else else
# We can't check that in the case of subprojects as we won't # We can't check that in the case of subprojects as we won't
# be able to build against an internal dependency (which is not built yet) # be able to build against an internal dependency (which is not built yet)
if not cc.compiles(''' gst_debug_disabled = cc.has_header_symbol('gst/gstconfig.h', 'GST_DISABLE_GST_DEBUG', dependencies: gst_dep)
#include <gst/gstconfig.h> endif
#ifdef GST_DISABLE_GST_DEBUG
#error "debugging disabled, make compiler fail" if gst_debug_disabled and cc.has_argument('-Wno-unused')
#endif''' , dependencies: gst_dep) add_project_arguments('-Wno-unused', language: 'c')
message('GStreamer debug system is disabled')
add_global_arguments('-Wno-unused', language: 'c')
else
message('GStreamer debug system is enabled')
endif
endif endif
subdir('validate') subdir('validate')