File: meson.build

package info (click to toggle)
qad 0.0~git20240206.43adc42%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240 kB
  • sloc: ansic: 1,604; perl: 114; sh: 9; makefile: 4
file content (93 lines) | stat: -rw-r--r-- 2,585 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
project('qad', 'c')

if not get_option('backend-ilm') and not get_option('backend-kms')
    error('Must set one of backend-kms and backend-ilm')
endif

config_h = configuration_data()

cjson_dep = dependency('libcjson')
http_dep = dependency('libmicrohttpd', static: get_option('static'))
png_dep = dependency('libpng', static: get_option('static'))

src_include = include_directories('include')
src_sources = [
    'src/backends/input/uinput.c',
    'src/backends/input/evdev_input.c',
    'src/backends/input/input_common.c',
    'src/server.c',
    'src/image/bmp.c',
    'src/image/png.c',
]

qad_deps = [
        http_dep,
        png_dep,
        cjson_dep
]

link_args = []
if get_option('static')
    link_args = ['-static']
endif

if get_option('backend-ilm')
    dep_scanner = dependency('wayland-scanner', native: true)
    prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
    proto_name = 'ivi-wm'
    proto_project = 'wayland-ivi-extension'
    base_file = proto_name
    output_type = 'client-header'
    xml_path = 'src/@0@/protocol/@1@.xml'.format(proto_project, proto_name)
    foreach output_type: [ 'client-header', 'private-code' ]
        if output_type == 'client-header'
            output_file = '@0@-client-protocol.h'.format(base_file)
        else
            output_file = '@0@-protocol.c'.format(base_file)
            if dep_scanner.version().version_compare('< 1.14.91')
                    output_type = 'code'
            endif
        endif

        var_name = output_file.underscorify()
        target = custom_target(
            '@0@ @1@'.format(base_file, output_type),
            command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
            input: xml_path,
            output: output_file,
        )

        set_variable(var_name, target)
    endforeach
    config_h.set('HAVE_ILM', '1')
    wayland_dep = dependency('wayland-client')
    qad_deps += wayland_dep
    src_sources += [
      'src/backends/screen/ilm.c',
      ivi_wm_protocol_c,
      ivi_wm_client_protocol_h,
    ]
    link_args = []
endif

if get_option('backend-kms')
    drm_dep = dependency('libdrm', static: get_option('static'))
    config_h.set('HAVE_KMS', '1')
    qad_deps += drm_dep
    src_sources += 'src/backends/screen/kms.c'
endif

executable(
    meson.project_name(),
    src_sources,
    include_directories: src_include,
    dependencies: qad_deps,
    c_args: [
        '-O3',
        '-Wall',
        '-Werror'
    ],
    link_args: link_args,
)

configure_file(output: 'config.h', configuration: config_h)