Remove glib and gobject dependencies everywhere
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-good / ext / soup / meson.build
1 soup_sources = [
2   'gstsoup.c',
3   'gstsoupelement.c',
4   'gstsouphttpclientsink.c',
5   'gstsouphttpsrc.c',
6   'gstsouploader.c',
7   'gstsouputils.c',
8 ]
9
10 soup_opt = get_option('soup')
11 if soup_opt.disabled()
12   subdir_done()
13 endif
14
15 libdl_dep = cc.find_library('dl', required: false)
16
17 static_args = []
18 static_deps = []
19 default_library = get_option('default_library')
20 if default_library in ['static', 'both']
21   libsoup2_dep = dependency('libsoup-2.4', version : '>=2.48',
22                             required : false, fallback : ['libsoup', 'libsoup_dep'],
23                             default_options: ['sysprof=disabled'])
24   libsoup3_dep = dependency('libsoup-3.0', required : false,
25                             fallback : ['libsoup3', 'libsoup_dep'])
26   if not libsoup2_dep.found() and not libsoup3_dep.found()
27     if soup_opt.enabled()
28       error('Either libsoup2 or libsoup3 is needed')
29     endif
30     subdir_done()
31   endif
32   if libsoup3_dep.found()
33     static_deps += libsoup3_dep
34     static_args += '-DSTATIC_SOUP=3'
35     message('soup plugin: using libsoup-3.0 for static build')
36   elif libsoup2_dep.found()
37     static_deps += libsoup2_dep
38     static_args += '-DSTATIC_SOUP=2'
39     message('soup plugin: using libsoup-2.4 for static build')
40   endif
41 endif
42
43 soup_library_kwargs = {
44   'sources' : soup_sources,
45   'link_args' : noseh_link_args,
46   'include_directories' : [configinc, libsinc],
47   'install' : true,
48   'install_dir' : plugins_install_dir,
49 }
50 soup_library_deps = [gst_dep, gstbase_dep, gsttag_dep, gmodule_dep, gio_dep, libdl_dep]
51 soup_library_c_args = gst_plugins_good_args
52
53 if default_library in ['shared', 'both']
54   gstsouphttpsrc_shared = shared_library('gstsoup',
55     c_args : soup_library_c_args,
56     dependencies : soup_library_deps,
57     kwargs: soup_library_kwargs,
58   )
59 endif
60
61 if default_library in ['static', 'both']
62   gstsouphttpsrc_static = static_library('gstsoup',
63     c_args : soup_library_c_args + static_args,
64     dependencies : soup_library_deps + static_deps,
65     kwargs: soup_library_kwargs,
66   )
67 endif
68
69 # Use the static library to generate the .pc file if it's available. The shared
70 # library .pc file does not have a Requires: on libsoup-2.4, and we use plugin
71 # .pc files to generate dependencies for linking plugins statically.
72 if default_library == 'shared'
73   pkgconfig.generate(gstsouphttpsrc_shared, install_dir : plugins_pkgconfig_install_dir)
74 else
75   pkgconfig.generate(gstsouphttpsrc_static, install_dir : plugins_pkgconfig_install_dir)
76 endif
77
78 # Add the shared library to the plugins list if available. We pass this list of
79 # plugins to hotdoc to generate the plugins cache, which introspects the plugin
80 # by loading it. We need the shared plugin for that.
81 if default_library == 'static'
82   plugins += [gstsouphttpsrc_static]
83 else
84   plugins += [gstsouphttpsrc_shared]
85 endif