meson: Pass -DGST_STATIC_COMPILATION for static builds
[platform/upstream/gstreamer.git] / gst / meson.build
index 33a985a..d29e370 100644 (file)
@@ -173,9 +173,16 @@ else
   gst_cdata.set('GST_DISABLE_REGISTRY_DEFINE', '#define GST_DISABLE_REGISTRY 1')
 endif
 
-# FIXME: add --disable-parse option? (but autotools doesn't seem to set this
-# define properly at all either even though it does expose the option)
-gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#undef GST_DISABLE_PARSE')
+gst_parse = get_option('gst_parse')
+if gst_parse
+  gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#undef GST_DISABLE_PARSE')
+else
+  gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#define GST_DISABLE_PARSE 1')
+endif
+
+gst_cdata.set10('GST_DISABLE_CAST_CHECKS_DEFINE', cast_checks.disabled())
+gst_cdata.set10('GST_DISABLE_GLIB_ASSERTS_DEFINE', glib_asserts.disabled())
+gst_cdata.set10('GST_DISABLE_GLIB_CHECKS_DEFINE', glib_checks.disabled())
 
 # FIXME: add --disable-plugin option?
 gst_cdata.set('GST_DISABLE_PLUGIN_DEFINE', '#undef GST_DISABLE_PLUGIN')
@@ -207,13 +214,15 @@ gst_enums = gnome.mkenums_simple('gstenumtypes',
 gstenum_h = gst_enums[1]
 gstenum_c = gst_enums[0]
 
+gst_parse_sources = []
+if gst_parse
+  subdir('parse')
+endif
 
-subdir('parse')
 subdir('printf')
 
 libgst_c_args = gst_c_args + [
   '-D_GNU_SOURCE',
-  '-DGST_EXPORTS',
   '-DG_LOG_DOMAIN=g_log_domain_gstreamer',
   '-DGST_DISABLE_DEPRECATED',
 ]
@@ -227,10 +236,11 @@ endif
 gst_incdirs = [configinc]
 gst_gen_sources = [gstenum_h]
 libgst = library('gstreamer-1.0', gst_sources,
-  gstenum_h, gstenum_c, grammar, parser, gst_registry_sources,
+  gstenum_h, gstenum_c, gst_parse_sources, gst_registry_sources,
   version : libversion,
   soversion : soversion,
-  c_args : libgst_c_args,
+  darwin_versions : osxversion,
+  c_args : libgst_c_args + ['-DBUILDING_GST'],
   include_directories : [configinc,
     # HACK, change include paths in .y and .l in final version.
     include_directories('parse')],
@@ -265,7 +275,13 @@ if build_gir
   )]
 endif
 
+gst_compile_args = []
+if get_option('default_library') == 'static'
+  gst_compile_args += ['-DGST_STATIC_COMPILATION']
+endif
+
 gst_dep = declare_dependency(link_with : libgst,
+  compile_args : gst_compile_args,
   include_directories : gst_incdirs,
   dependencies : [glib_dep, gobject_dep, gmodule_dep],
   # Everything that uses libgst needs this built to compile