1 project('fribidi', 'c', version: '1.0.10',
2 meson_version : '>= 0.48')
8 # If any functions have been added:
12 # If binary backwards compatibility has been broken:
19 libversion = '@0@.@1@.0'.format(soversion, interface_version, interface_age)
21 # C compiler. This is the cross compiler if we're cross-compiling
22 cc = meson.get_compiler('c')
24 if cc.get_id() == 'gcc' and cc.has_argument('-ansi')
25 add_project_arguments('-ansi', language: 'c')
29 have_visibility_hidden = false
30 if host_machine.system() != 'windows'
31 have_visibility_hidden = cc.has_argument('-fvisibility=hidden')
32 if have_visibility_hidden
33 add_project_arguments('-fvisibility=hidden', language: 'c')
37 # Must explicitly make symbols public if default visibility is hidden
39 fribidi_static_cargs = []
40 if have_visibility_hidden
41 visibility_args = ['-DFRIBIDI_ENTRY=__attribute__ ((visibility ("default")))']
43 if host_machine.system() == 'windows'
44 if get_option('default_library') == 'static'
45 fribidi_static_cargs = ['-DFRIBIDI_LIB_STATIC']
50 cdata = configuration_data()
52 # Checks for library functions
53 foreach f : ['memmove', 'memset', 'strdup']
54 cdata.set('HAVE_' + f.to_upper(), cc.has_function(f))
57 # Checks for header files
58 # Some HAVE_FOO defines need to be defined to either 1 or 0, others need to
59 # be defined or undefined. The code base is a bit inconsistent there.
60 foreach h : ['stdlib.h', 'string.h', 'memory.h']
61 cdata.set10('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
63 foreach h : ['strings.h', 'sys/times.h']
64 cdata.set('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
67 # Not entirely correct, but sufficient for us. Should move away from this
68 # ancient define and just include individual headers based on individual defs
69 if cc.has_header('strings.h')
70 # define to 1 or leave undefined otherwise, don't simplify
71 cdata.set('STDC_HEADERS', 1)
74 # This is available pretty much everywhere
75 cdata.set('HAVE_STRINGIZE', 1)
77 if get_option('debug')
81 no_deprecated = not get_option('deprecated')
82 cdata.set('FRIBIDI_NO_DEPRECATED', no_deprecated)
85 config_h = configure_file(output: 'config.h', configuration: cdata)
87 incs = include_directories('.', 'lib', 'gen.tab')
94 if get_option('tests')
102 pkg = import('pkgconfig')
103 pkg.generate(name: 'GNU FriBidi',
105 description: 'Unicode Bidirectional Algorithm Library',
106 libraries: libfribidi,
108 version: meson.project_version())