3 native_cc = meson.get_compiler('c')
5 # Don't pick up top-level config.h, as that has defines for the cross-compiler
6 # (if we're cross-compiling), but here we need values for the host compiler/env
7 # in that case. We shall pass those on the command line since it's just a few.
8 native_args = ['-UHAVE_CONFIG_H']
10 # This is available pretty much everywhere
11 native_args += ['-DHAVE_STRINGIZE']
13 native_args += ['-DDONT_HAVE_FRIBIDI_CONFIG_H']
15 if native_cc.has_header('stdlib.h')
16 native_args += ['-DHAVE_STDLIB_H']
19 if native_cc.has_header('string.h')
20 native_args += ['-DHAVE_STRING_H']
23 if native_cc.has_header('strings.h')
24 native_args += ['-DHAVE_STRINGS_H']
26 # Not entirely correct, but sufficient for us. Should move away from this
27 # ancient define and just include individual headers based on individual defs.
28 # stdlib.h and string.h are standard nowadays, but strings.h not (msvc)
29 native_args += ['-DSTDC_HEADERS=1']
32 gen_unicode_version = executable('gen-unicode-version',
33 'gen-unicode-version.c',
34 include_directories: incs,
38 fribidi_unicode_version_h = custom_target('fribidi-unicode-version.h',
39 input: files('unidata/ReadMe.txt', 'unidata/BidiMirroring.txt'),
40 output: 'fribidi-unicode-version.h',
41 command: [gen_unicode_version, '@INPUT0@', '@INPUT1@', 'gen-unicode-version'],
43 install_dir: join_paths(get_option('includedir'), 'fribidi'),
49 ['bidi-type', files('unidata/UnicodeData.txt')],
50 ['joining-type', files('unidata/UnicodeData.txt', 'unidata/ArabicShaping.txt')],
51 ['arabic-shaping', files('unidata/UnicodeData.txt')],
52 ['mirroring', files('unidata/BidiMirroring.txt')],
53 ['brackets', files('unidata/BidiBrackets.txt', 'unidata/UnicodeData.txt')],
54 ['brackets-type', files('unidata/BidiBrackets.txt')],
57 generated_tab_include_files = []
60 gen_prog_name = 'gen-@0@-tab'.format(tab[0])
61 gen_prog_src = 'gen-@0@-tab.c'.format(tab[0])
62 gen_prog_out = '@0@.tab.i'.format(tab[0])
63 gen_prog_inputs = tab[1]
65 gen_exe = executable(gen_prog_name,
66 fribidi_unicode_version_h,
67 gen_prog_src, 'packtab.c',
68 include_directories: incs,
72 tab_inc_file = custom_target(gen_prog_name,
73 input: gen_prog_inputs,
75 command: [gen_exe, COMPRESSION, '@INPUT@', gen_prog_name],
78 generated_tab_include_files += [tab_inc_file]