ad2f5d3a7c761f00f07408f992243a7b8b9d752a
[platform/upstream/gstreamer.git] / subprojects / gstreamer / tools / meson.build
1 # If tools are disabled, we still allow building them against gst-full
2 # later, so populate the gst_tools dictionary in any case.
3 gst_tools = {}
4
5 tools = ['gst-inspect', 'gst-stats', 'gst-typefind']
6
7 extra_launch_dep = []
8 extra_launch_arg = []
9
10 if gst_parse
11   if host_system == 'windows' and not building_for_uwp
12     winmm_lib = cc.find_library('winmm', required: false)
13     if winmm_lib.found() and cc.has_header('timeapi.h')
14       extra_launch_dep += [winmm_lib]
15       extra_launch_arg += ['-DHAVE_WINMM']
16     endif
17   endif
18
19   tools += ['gst-launch']
20 endif
21
22 foreach tool : tools
23   exe_name = '@0@-@1@'.format(tool, apiversion)
24   src_file = '@0@.c'.format(tool)
25   extra_deps = []
26   extra_c_args = []
27
28   if tool == 'gst-launch'
29     extra_deps += extra_launch_dep
30     extra_c_args += extra_launch_arg
31   endif
32
33   man_page = files('@0@-1.0.1'.format(tool))
34   if not get_option('tools').disabled()
35     executable(exe_name,
36       src_file,
37       install: true,
38       include_directories : [configinc],
39       dependencies : [glib_dep, gobject_dep, gmodule_dep, mathlib, gst_dep] + extra_deps,
40       c_args: gst_c_args + extra_c_args + ['-DG_LOG_DOMAIN="@0@"'.format(exe_name)],
41     )
42
43     install_man(man_page)
44   endif
45
46   gst_tools += {tool:
47     {
48       'files': files(src_file),
49       'deps': [glib_dep, gobject_dep, gmodule_dep, mathlib, gst_dep] + extra_deps,
50       'extra_c_args': extra_c_args,
51       'man_page': man_page,
52     }
53   }
54 endforeach