win32: Enable high-resolution timer for MinGW build
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-base / tools / meson.build
1 tool_deps = [pbutils_dep, audio_dep, video_dep, tag_dep, gst_dep, gst_base_dep, gmodule_dep]
2
3 extra_args = []
4 extra_deps = []
5
6 if host_system == 'windows'
7   # Check whether we're building for UWP apps, and if so, will not link winmm
8   # of which APIs are for WIN32 desktop
9   building_for_uwp = false
10   code = '''
11   #include <windows.h>
12   #if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
13   #error "Not building for UWP"
14   #endif'''
15   if cc.compiles(code, name : 'building for UWP')
16     building_for_uwp = true
17   endif
18
19   if not building_for_uwp
20     winmm_lib = cc.find_library('winmm', required: false)
21     if winmm_lib.found() and cc.has_header('mmsystem.h')
22       extra_args += ['-DHAVE_WINMM']
23       extra_deps += [winmm_lib]
24     endif
25   endif
26 endif
27
28   gst_tools = {
29     'gst-device-monitor': {
30       'files': files('gst-device-monitor.c'),
31       'deps': tool_deps,
32       'man_page': files('gst-device-monitor-@0@.1'.format(api_version))
33     },
34     'gst-discoverer': {
35       'files': files('gst-discoverer.c'),
36       'deps': tool_deps,
37       'man_page': files('gst-discoverer-@0@.1'.format(api_version))
38     },
39     'gst-play': {
40       'files': files('gst-play.c', 'gst-play-kb.c'),
41       'deps': tool_deps,
42       'man_page': files('gst-play-@0@.1'.format(api_version))
43     },
44   }
45
46 if not get_option('tools').disabled()
47   foreach tool, data: gst_tools
48     exe_name = '@0@-@1@'.format(tool, api_version)
49     executable(exe_name,
50       data.get('files'),
51       install: true,
52       include_directories : [configinc],
53       dependencies : data.get('deps'),
54       c_args: data.get('extra_c_args', []) + gst_plugins_base_args + ['-DG_LOG_DOMAIN="@0@"'.format(exe_name)],
55     )
56
57     if data.has_key('man_page')
58       install_man(data.get('man_page'))
59     endif
60   endforeach
61
62 endif