-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathmeson.build
51 lines (44 loc) · 1.81 KB
/
meson.build
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
project('xclip', 'c',
version : '0.13',
default_options : ['warning_level=3', 'c_std=c99', 'b_lto=true'])
add_project_arguments(['-DPACKAGE_NAME="xclip"',
'-DPACKAGE_VERSION=' + '"' + meson.project_version() + '"'],
language : 'c')
dep = [dependency('x11'), dependency('xmu')]
inc = [include_directories('.')]
cc = meson.get_compiler('c')
if cc.has_function('iconv_open') == true
# #define LIBICONV_PLUG prevents a header conflict when the system
# provides the iconv library and its iconv.h header, and libiconv is installed
# at the same time.
add_project_arguments('-DLIBICONV_PLUG', language : 'c')
iconv_available = true
else
iconv_inc = include_directories(get_option('prefix') / get_option('includedir'))
iconv_dep = cc.find_library('iconv',
dirs : get_option('prefix') / get_option('libdir'),
has_headers : 'iconv.h',
header_include_directories : iconv_inc,
required : false)
iconv_available = iconv_dep.found()
if iconv_available == true
inc += iconv_inc
dep += iconv_dep
endif
endif
if iconv_available == true
add_project_arguments('-DHAVE_ICONV', language : 'c')
endif
executable('xclip',
['xclib.c', 'xclip.c', 'xcprint.c'],
include_directories : inc,
dependencies : dep,
install : true)
borked_test = executable('borked',
['borked.c', 'xclib.c', 'xcprint.c'],
include_directories : inc,
dependencies : dep)
test('borked', borked_test)
install_data(['xclip-copyfile', 'xclip-cutfile', 'xclip-pastefile'],
install_dir : get_option('prefix') / get_option('bindir'))
install_man(['xclip-copyfile.1', 'xclip.1'])