Помоги сделать GitVerse лучше — пройди опрос
/
meson.build 
117 строк · 2.7 Кб
1
project('usbredir', 'c',
2
    version: '0.15.0',
3
    license: 'LGPLv2.1+',
4
    meson_version : '>= 0.53',
5
    default_options : [
6
        'buildtype=debugoptimized',
7
        'warning_level=1',
8
    ])
9

10
summary_info = {'prefix': get_option('prefix')}
11

12
usbredir_include_root_dir = include_directories('.')
13

14
cc_flags = [
15
    '--param=ssp-buffer-size=4',
16
]
17
if host_machine.system() != 'windows'
18
    cc_flags += [ '-D_FORTIFY_SOURCE=2' ]
19
    if not get_option('stack_protector').disabled()
20
        cc_flags += [ '-fstack-protector' ]
21
    endif
22
endif
23

24
# Check if we are building from .git
25
git = run_command('test', '-d', '.git', check : false).returncode() == 0
26
git_werror = get_option('git_werror')
27
if git_werror.enabled() or git_werror.auto() and git
28
  cc_flags += [ '-Werror' ]
29
endif
30

31
compiler = meson.get_compiler('c')
32
supported_cc_flags = compiler.get_supported_arguments(cc_flags)
33
add_project_arguments(supported_cc_flags, language: 'c')
34

35
config = configuration_data()
36

37
if get_option('extra-checks')
38
  config.set('ENABLE_EXTRA_CHECKS', '1')
39
endif
40

41
config.set('USBREDIR_VISIBLE', '')
42
foreach visibility : [
43
    '__attribute__((visibility ("default")))',
44
    '__attribute__((dllexport))',
45
    '__declspec(dllexport)',
46
]
47
    code = '@0@ int func() { return 123; }'.format(visibility)
48
    if compiler.compiles(code, name : 'visibility check')
49
	config.set('USBREDIR_VISIBLE', visibility)
50
	break
51
    endif
52
endforeach
53

54
#
55
# write config.h
56
#
57
proj_name = meson.project_name()
58
proj_version = meson.project_version()
59
config_data = {
60
    'VERSION' : proj_version,
61
    'PACKAGE_VERSION' : proj_version,
62
    'PACKAGE_STRING' : '@0@ @1@'.format(proj_name, proj_version),
63
    'PACKAGE_BUGREPORT' : 'https://gitlab.freedesktop.org/spice/usbredir/issues',
64
}
65

66
foreach key, value : config_data
67
    config.set_quoted(key, value)
68
endforeach
69

70
#
71
# check for system headers
72
#
73
headers = [
74
    'inttypes.h',
75
    'stdint.h',
76
    'stdlib.h',
77
    'strings.h',
78
    'string.h',
79
    'sys/stat.h',
80
    'sys/types.h',
81
    'unistd.h',
82
]
83

84
foreach header : headers
85
    if compiler.has_header(header)
86
        config.set('HAVE_@0@'.format(header.underscorify().to_upper()), '1')
87
    endif
88
endforeach
89

90
if host_machine.system() == 'windows'
91
    wixl_arch = 'x64'
92
    if host_machine.cpu() != 'x86_64'
93
        wixl_arch = 'x86'
94
    endif
95
    config.set('WIXL_ARCH', wixl_arch)
96
endif
97

98
configure_file(output : 'config.h', configuration : config)
99

100
subdir('usbredirparser')
101
subdir('usbredirhost')
102
if get_option('tools').enabled()
103
    subdir('tools')
104
endif
105
if host_machine.system() != 'windows'
106
    subdir('usbredirtestclient')
107

108
    if get_option('fuzzing').enabled()
109
        subdir('fuzzing')
110
    endif
111
endif
112
if get_option('tests').enabled()
113
    subdir('tests')
114
endif
115
subdir('data')
116

117
summary(summary_info, bool_yn: true)
118

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.