forked from fribidi/fribidi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
97 lines (80 loc) · 2.54 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
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
94
95
96
97
project('fribidi', 'c', version: '1.0.16',
meson_version : '>= 0.54')
# New release:
# interface_age++
# micro version++
#
# If any functions have been added:
# interface_age = 0
# interface_version++
#
# If binary backwards compatibility has been broken:
# panic!
interface_age = 0
interface_version = 4
soversion = 0
libversion = '@0@.@[email protected]'.format(soversion, interface_version, interface_age)
# C compiler. This is the cross compiler if we're cross-compiling
cc = meson.get_compiler('c')
if cc.get_id() == 'gcc' and cc.has_argument('-ansi')
add_project_arguments('-ansi', language: 'c')
endif
# Handle symbol visibility for Windows
fribidi_static_cargs = []
fribidi_build_cargs = []
if host_machine.system() == 'windows'
fribidi_build_cargs = ['-DFRIBIDI_BUILD']
if get_option('default_library') == 'static'
fribidi_static_cargs = ['-DFRIBIDI_LIB_STATIC']
endif
endif
cdata = configuration_data()
# Checks for library functions
foreach f : ['memmove', 'memset', 'strdup']
cdata.set('HAVE_' + f.to_upper(), cc.has_function(f))
endforeach
# Checks for header files
# Some HAVE_FOO defines need to be defined to either 1 or 0, others need to
# be defined or undefined. The code base is a bit inconsistent there.
foreach h : ['stdlib.h', 'string.h', 'memory.h']
cdata.set10('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
endforeach
foreach h : ['strings.h', 'sys/times.h']
cdata.set('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
endforeach
# Not entirely correct, but sufficient for us. Should move away from this
# ancient define and just include individual headers based on individual defs
if cc.has_header('strings.h')
# define to 1 or leave undefined otherwise, don't simplify
cdata.set('STDC_HEADERS', 1)
endif
# This is available pretty much everywhere
cdata.set('HAVE_STRINGIZE', 1)
if get_option('debug')
cdata.set('DEBUG', 1)
endif
no_deprecated = not get_option('deprecated')
cdata.set('FRIBIDI_NO_DEPRECATED', no_deprecated)
# write config.h
config_h = configure_file(output: 'config.h', configuration: cdata)
incs = include_directories('.', 'lib', 'gen.tab')
subdir('gen.tab')
subdir('lib')
if get_option('bin') or get_option('tests')
subdir('bin')
endif
if get_option('tests')
subdir('test')
endif
if get_option('docs')
subdir('doc')
endif
# fribidi.pc
pkg = import('pkgconfig')
pkg.generate(libfribidi,
name: 'GNU FriBidi',
filebase: 'fribidi',
description: 'Unicode Bidirectional Algorithm Library',
extra_cflags: fribidi_static_cargs,
subdirs: 'fribidi',
version: meson.project_version())