1fc_sources = [ 2 'fcatomic.c', 3 'fccache.c', 4 'fccfg.c', 5 'fccharset.c', 6 'fccompat.c', 7 'fcdbg.c', 8 'fcdefault.c', 9 'fcdir.c', 10 'fcformat.c', 11 'fcfreetype.c', 12 'fcfs.c', 13 'fcptrlist.c', 14 'fchash.c', 15 'fcinit.c', 16 'fclang.c', 17 'fclist.c', 18 'fcmatch.c', 19 'fcmatrix.c', 20 'fcname.c', 21 'fcobjs.c', 22 'fcpat.c', 23 'fcrange.c', 24 'fcserialize.c', 25 'fcstat.c', 26 'fcstr.c', 27 'fcweight.c', 28 'fcxml.c', 29 'ftglue.c', 30] 31 32# FIXME: obviously fragile, cc.preprocess would be sweet 33cpp = cc.cmd_array() 34if cc.get_argument_syntax() == 'gcc' 35 cpp += ['-E', '-P'] 36elif cc.get_argument_syntax() == 'msvc' 37 cpp += ['/EP'] 38else 39 error('FIXME: implement cc.preprocess') 40endif 41 42cpp += ['-I', join_paths(meson.current_source_dir(), '..')] 43 44fcobjshash_gperf = custom_target('fcobjshash.gperf', 45 input: 'fcobjshash.gperf.h', 46 output: 'fcobjshash.gperf', 47 command: [python3, files('cutout.py')[0], '@INPUT@', '@OUTPUT@', '@BUILD_ROOT@', cpp], 48 build_by_default: true, 49) 50 51fcobjshash_h = custom_target('fcobjshash.h', 52 input: fcobjshash_gperf, 53 output: 'fcobjshash.h', 54 command: [gperf, '--pic', '-m', '100', '@INPUT@', '--output-file', '@OUTPUT@'] 55) 56 57# Define FcPublic appropriately for exports on windows 58fc_extra_c_args = [] 59 60if cc.get_argument_syntax() == 'msvc' 61 fc_extra_c_args += '-DFcPublic=__declspec(dllexport)' 62endif 63 64libfontconfig = library('fontconfig', 65 fc_sources, alias_headers, ft_alias_headers, fclang_h, fccase_h, fcobjshash_h, 66 c_args: c_args + fc_extra_c_args, 67 include_directories: incbase, 68 dependencies: deps, 69 install: true, 70 soversion: soversion, 71 version: libversion, 72 darwin_versions: osxversion, 73) 74 75fontconfig_dep = declare_dependency(link_with: libfontconfig, 76 include_directories: incbase, 77 dependencies: deps, 78) 79 80pkgmod.generate(libfontconfig, 81 description: 'Font configuration and customization library', 82 filebase: 'fontconfig', 83 name: 'Fontconfig', 84 requires: ['freetype2 ' + freetype_req], 85 version: fc_version, 86 variables: [ 87 'sysconfdir=@0@'.format(join_paths(prefix, get_option('sysconfdir'))), 88 'localstatedir=@0@'.format(join_paths(prefix, get_option('localstatedir'))), 89 'confdir=@0@'.format(fc_baseconfigdir), 90 'cachedir=@0@'.format(fc_cachedir), 91 ]) 92