diff options
Diffstat (limited to 'src/meson.build')
-rw-r--r-- | src/meson.build | 236 |
1 files changed, 168 insertions, 68 deletions
diff --git a/src/meson.build b/src/meson.build index bda44c683..5d01d9862 100644 --- a/src/meson.build +++ b/src/meson.build @@ -3,7 +3,7 @@ hb_version_h = configure_file( input: 'hb-version.h.in', output: 'hb-version.h', install: true, - install_dir: join_paths(get_option('includedir'), meson.project_name())) + install_dir: get_option('includedir') / meson.project_name()) # Base and default-included sources and headers hb_base_sources = files( @@ -29,6 +29,7 @@ hb_base_sources = files( 'hb-blob.cc', 'hb-blob.hh', 'hb-buffer-serialize.cc', + 'hb-buffer-verify.cc', 'hb-buffer.cc', 'hb-buffer.hh', 'hb-cache.hh', @@ -54,8 +55,8 @@ hb_base_sources = files( 'hb-map.cc', 'hb-map.hh', 'hb-meta.hh', - 'hb-ms-feature-ranges.cc', 'hb-ms-feature-ranges.hh', + 'hb-multimap.hh', 'hb-mutex.hh', 'hb-null.hh', 'hb-number.cc', @@ -92,6 +93,74 @@ hb_base_sources = files( 'hb-ot-layout-gdef-table.hh', 'hb-ot-layout-gpos-table.hh', 'hb-ot-layout-gsub-table.hh', + 'OT/glyf/glyf.hh', + 'OT/glyf/glyf-helpers.hh', + 'OT/glyf/loca.hh', + 'OT/glyf/path-builder.hh', + 'OT/glyf/Glyph.hh', + 'OT/glyf/GlyphHeader.hh', + 'OT/glyf/SimpleGlyph.hh', + 'OT/glyf/CompositeGlyph.hh', + 'OT/glyf/SubsetGlyph.hh', + 'OT/Layout/types.hh', + 'OT/Layout/Common/Coverage.hh', + 'OT/Layout/Common/CoverageFormat1.hh', + 'OT/Layout/Common/CoverageFormat2.hh', + 'OT/Layout/Common/RangeRecord.hh', + 'OT/Layout/GPOS/AnchorFormat1.hh', + 'OT/Layout/GPOS/AnchorFormat2.hh', + 'OT/Layout/GPOS/AnchorFormat3.hh', + 'OT/Layout/GPOS/Anchor.hh', + 'OT/Layout/GPOS/AnchorMatrix.hh', + 'OT/Layout/GPOS/ChainContextPos.hh', + 'OT/Layout/GPOS/Common.hh', + 'OT/Layout/GPOS/ContextPos.hh', + 'OT/Layout/GPOS/CursivePosFormat1.hh', + 'OT/Layout/GPOS/CursivePos.hh', + 'OT/Layout/GPOS/ExtensionPos.hh', + 'OT/Layout/GPOS/GPOS.hh', + 'OT/Layout/GPOS/LigatureArray.hh', + 'OT/Layout/GPOS/MarkArray.hh', + 'OT/Layout/GPOS/MarkBasePosFormat1.hh', + 'OT/Layout/GPOS/MarkBasePos.hh', + 'OT/Layout/GPOS/MarkLigPosFormat1.hh', + 'OT/Layout/GPOS/MarkLigPos.hh', + 'OT/Layout/GPOS/MarkMarkPosFormat1.hh', + 'OT/Layout/GPOS/MarkMarkPos.hh', + 'OT/Layout/GPOS/MarkRecord.hh', + 'OT/Layout/GPOS/PairPosFormat1.hh', + 'OT/Layout/GPOS/PairPosFormat2.hh', + 'OT/Layout/GPOS/PairPos.hh', + 'OT/Layout/GPOS/PairSet.hh', + 'OT/Layout/GPOS/PairValueRecord.hh', + 'OT/Layout/GPOS/PosLookup.hh', + 'OT/Layout/GPOS/PosLookupSubTable.hh', + 'OT/Layout/GPOS/SinglePosFormat1.hh', + 'OT/Layout/GPOS/SinglePosFormat2.hh', + 'OT/Layout/GPOS/SinglePos.hh', + 'OT/Layout/GPOS/ValueFormat.hh', + 'OT/Layout/GSUB/AlternateSet.hh', + 'OT/Layout/GSUB/AlternateSubstFormat1.hh', + 'OT/Layout/GSUB/AlternateSubst.hh', + 'OT/Layout/GSUB/ChainContextSubst.hh', + 'OT/Layout/GSUB/Common.hh', + 'OT/Layout/GSUB/ContextSubst.hh', + 'OT/Layout/GSUB/ExtensionSubst.hh', + 'OT/Layout/GSUB/GSUB.hh', + 'OT/Layout/GSUB/Ligature.hh', + 'OT/Layout/GSUB/LigatureSet.hh', + 'OT/Layout/GSUB/LigatureSubstFormat1.hh', + 'OT/Layout/GSUB/LigatureSubst.hh', + 'OT/Layout/GSUB/MultipleSubstFormat1.hh', + 'OT/Layout/GSUB/MultipleSubst.hh', + 'OT/Layout/GSUB/ReverseChainSingleSubstFormat1.hh', + 'OT/Layout/GSUB/ReverseChainSingleSubst.hh', + 'OT/Layout/GSUB/Sequence.hh', + 'OT/Layout/GSUB/SingleSubstFormat1.hh', + 'OT/Layout/GSUB/SingleSubstFormat2.hh', + 'OT/Layout/GSUB/SingleSubst.hh', + 'OT/Layout/GSUB/SubstLookup.hh', + 'OT/Layout/GSUB/SubstLookupSubTable.hh', 'hb-ot-layout-gsubgpos.hh', 'hb-ot-layout-jstf-table.hh', 'hb-ot-layout.cc', @@ -113,30 +182,29 @@ hb_base_sources = files( 'hb-ot-os2-unicode-ranges.hh', 'hb-ot-post-macroman.hh', 'hb-ot-post-table.hh', - 'hb-ot-shape-complex-arabic-fallback.hh', - 'hb-ot-shape-complex-arabic-joining-list.hh', - 'hb-ot-shape-complex-arabic-table.hh', - 'hb-ot-shape-complex-arabic-win1256.hh', - 'hb-ot-shape-complex-arabic.cc', - 'hb-ot-shape-complex-arabic.hh', - 'hb-ot-shape-complex-default.cc', - 'hb-ot-shape-complex-hangul.cc', - 'hb-ot-shape-complex-hebrew.cc', - 'hb-ot-shape-complex-indic-table.cc', - 'hb-ot-shape-complex-indic.cc', - 'hb-ot-shape-complex-indic.hh', - 'hb-ot-shape-complex-khmer.cc', - 'hb-ot-shape-complex-khmer.hh', - 'hb-ot-shape-complex-myanmar.cc', - 'hb-ot-shape-complex-myanmar.hh', - 'hb-ot-shape-complex-syllabic.cc', - 'hb-ot-shape-complex-syllabic.hh', - 'hb-ot-shape-complex-thai.cc', - 'hb-ot-shape-complex-use-table.hh', - 'hb-ot-shape-complex-use.cc', - 'hb-ot-shape-complex-vowel-constraints.cc', - 'hb-ot-shape-complex-vowel-constraints.hh', - 'hb-ot-shape-complex.hh', + 'hb-ot-shaper-arabic-fallback.hh', + 'hb-ot-shaper-arabic-joining-list.hh', + 'hb-ot-shaper-arabic-pua.hh', + 'hb-ot-shaper-arabic-table.hh', + 'hb-ot-shaper-arabic-win1256.hh', + 'hb-ot-shaper-arabic.cc', + 'hb-ot-shaper-arabic.hh', + 'hb-ot-shaper-default.cc', + 'hb-ot-shaper-hangul.cc', + 'hb-ot-shaper-hebrew.cc', + 'hb-ot-shaper-indic-table.cc', + 'hb-ot-shaper-indic.cc', + 'hb-ot-shaper-indic.hh', + 'hb-ot-shaper-khmer.cc', + 'hb-ot-shaper-myanmar.cc', + 'hb-ot-shaper-syllabic.cc', + 'hb-ot-shaper-syllabic.hh', + 'hb-ot-shaper-thai.cc', + 'hb-ot-shaper-use-table.hh', + 'hb-ot-shaper-use.cc', + 'hb-ot-shaper-vowel-constraints.cc', + 'hb-ot-shaper-vowel-constraints.hh', + 'hb-ot-shaper.hh', 'hb-ot-shape-fallback.cc', 'hb-ot-shape-fallback.hh', 'hb-ot-shape-normalize.cc', @@ -184,19 +252,19 @@ hb_base_ragel_generated_sources = files( 'hb-buffer-deserialize-json.hh', 'hb-buffer-deserialize-text.hh', 'hb-number-parser.hh', - 'hb-ot-shape-complex-indic-machine.hh', - 'hb-ot-shape-complex-khmer-machine.hh', - 'hb-ot-shape-complex-myanmar-machine.hh', - 'hb-ot-shape-complex-use-machine.hh', + 'hb-ot-shaper-indic-machine.hh', + 'hb-ot-shaper-khmer-machine.hh', + 'hb-ot-shaper-myanmar-machine.hh', + 'hb-ot-shaper-use-machine.hh', ) hb_base_ragel_sources = [ 'hb-buffer-deserialize-json.rl', 'hb-buffer-deserialize-text.rl', 'hb-number-parser.rl', - 'hb-ot-shape-complex-indic-machine.rl', - 'hb-ot-shape-complex-khmer-machine.rl', - 'hb-ot-shape-complex-myanmar-machine.rl', - 'hb-ot-shape-complex-use-machine.rl', + 'hb-ot-shaper-indic-machine.rl', + 'hb-ot-shaper-khmer-machine.rl', + 'hb-ot-shaper-myanmar-machine.rl', + 'hb-ot-shaper-use-machine.rl', ] hb_base_headers = files( @@ -205,6 +273,7 @@ hb_base_headers = files( 'hb-blob.h', 'hb-buffer.h', 'hb-common.h', + 'hb-cplusplus.hh', 'hb-deprecated.h', 'hb-draw.h', 'hb-face.h', @@ -266,6 +335,7 @@ hb_subset_sources = files( 'hb-ot-cff1-table.cc', 'hb-ot-cff2-table.cc', 'hb-static.cc', + 'hb-subset-accelerator.hh', 'hb-subset-cff-common.cc', 'hb-subset-cff-common.hh', 'hb-subset-cff1.cc', @@ -276,11 +346,23 @@ hb_subset_sources = files( 'hb-subset-input.hh', 'hb-subset-plan.cc', 'hb-subset-plan.hh', + 'hb-subset-repacker.cc', + 'graph/gsubgpos-context.cc', + 'graph/gsubgpos-context.hh', + 'graph/gsubgpos-graph.hh', + 'graph/pairpos-graph.hh', + 'graph/markbasepos-graph.hh', + 'graph/coverage-graph.hh', + 'graph/classdef-graph.hh', + 'graph/split-helpers.hh', 'hb-subset.cc', 'hb-subset.hh', ) -hb_subset_headers = files('hb-subset.h') +hb_subset_headers = files( + 'hb-subset.h', + 'hb-subset-repacker.h' +) hb_gobject_sources = files( 'hb-gobject-structs.cc' @@ -298,7 +380,9 @@ if not has_ragel and get_option('ragel_subproject') has_ragel = true endif if not has_ragel - warning('You have to install ragel if you are going to develop HarfBuzz itself') + if not meson.is_subproject() + warning('You have to install ragel if you are going to develop HarfBuzz itself') + endif else ragel_helper = find_program('gen-ragel-artifacts.py') foreach rl : hb_base_ragel_sources @@ -331,33 +415,40 @@ harfbuzz_deps = [thread_dep, m_dep] + harfbuzz_extra_deps libharfbuzz_link_language = 'c' +hb_features = configuration_data() + if conf.get('HAVE_FREETYPE', 0) == 1 hb_sources += hb_ft_sources hb_headers += hb_ft_headers harfbuzz_deps += [freetype_dep] + hb_features.set('HB_HAS_FREETYPE', 1) endif if conf.get('HAVE_GDI', 0) == 1 hb_sources += hb_gdi_sources hb_headers += hb_gdi_headers harfbuzz_deps += gdi_uniscribe_deps + hb_features.set('HB_HAS_GDI', 1) endif if conf.get('HAVE_GRAPHITE2', 0) == 1 hb_sources += hb_graphite2_sources hb_headers += hb_graphite2_headers harfbuzz_deps += [graphite2_dep, graphite_dep] + hb_features.set('HB_HAS_GRAPHITE', 1) endif if conf.get('HAVE_GLIB', 0) == 1 hb_sources += hb_glib_sources hb_headers += hb_glib_headers harfbuzz_deps += [glib_dep] + hb_features.set('HB_HAS_GLIB', 1) endif if conf.get('HAVE_UNISCRIBE', 0) == 1 hb_sources += hb_uniscribe_sources hb_headers += hb_uniscribe_headers + hb_features.set('HB_HAS_UNISCRIBE', 1) endif if conf.get('HAVE_DIRECTWRITE', 0) == 1 @@ -365,12 +456,14 @@ if conf.get('HAVE_DIRECTWRITE', 0) == 1 hb_headers += hb_directwrite_headers # hb-directwrite needs a C++ linker libharfbuzz_link_language = 'cpp' + hb_features.set('HB_HAS_DIRECTWRITE', 1) endif if conf.get('HAVE_CORETEXT', 0) == 1 hb_sources += hb_coretext_sources hb_headers += hb_coretext_headers harfbuzz_deps += coretext_deps + hb_features.set('HB_HAS_CORETEXT', 1) endif have_icu = conf.get('HAVE_ICU', 0) == 1 @@ -380,8 +473,17 @@ if have_icu and have_icu_builtin hb_sources += hb_icu_sources hb_headers += hb_icu_headers harfbuzz_deps += [icu_dep] + hb_features.set('HB_HAS_ICU', 1) endif +hb_features_h = configure_file(input: 'hb-features.h.in', + output: 'hb-features.h', + configuration: hb_features, + install: true, + install_dir: get_option('includedir') / meson.project_name()) + +# Base and default-included sources and headers + # harfbuzz gen_def = find_program('gen-def.py') @@ -399,7 +501,7 @@ defs_list = [harfbuzz_def] version = '0.@0@.0'.format(hb_version_int) extra_hb_cpp_args = [] -if cpp.get_id() == 'msvc' +if cpp.get_argument_syntax() == 'msvc' if get_option('default_library') != 'static' extra_hb_cpp_args += '-DHB_DLL_EXPORT' endif @@ -453,6 +555,14 @@ libharfbuzz_subset = library('harfbuzz-subset', hb_subset_sources, link_language: 'c', ) +custom_target('harfbuzz-subset.cc', + build_by_default: true, + output: 'harfbuzz-subset.cc', + input: hb_base_sources + hb_subset_sources, + command: [find_program('gen-harfbuzzcc.py'), + '@OUTPUT@', meson.current_source_dir(), '@INPUT@'], +) + libharfbuzz_subset_dep = declare_dependency( link_with: libharfbuzz_subset, include_directories: incsrc, @@ -461,7 +571,7 @@ libharfbuzz_subset_dep = declare_dependency( if get_option('tests').enabled() # TODO: MSVC gives the following, # error LNK2019: unresolved external symbol "unsigned __int64 const * const _hb_NullPool" - if cpp.get_id() != 'msvc' + if cpp.get_argument_syntax() != 'msvc' noinst_programs = { 'main': 'main.cc', 'test-basics': 'test.cc', @@ -471,6 +581,7 @@ if get_option('tests').enabled() 'test-ot-glyphname': 'test-ot-glyphname.cc', 'test-ot-gpos-size-params': 'test-gpos-size-params.cc', 'test-ot-gsub-would-substitute': 'test-gsub-would-substitute.cc', + 'test-use-table': 'test-use-table.cc', } foreach name, source : noinst_programs executable(name, source, @@ -485,19 +596,23 @@ if get_option('tests').enabled() compiled_tests = { 'test-algs': ['test-algs.cc', 'hb-static.cc'], 'test-array': ['test-array.cc'], - 'test-repacker': ['test-repacker.cc', 'hb-static.cc'], - 'test-priority-queue': ['test-priority-queue.cc', 'hb-static.cc'], 'test-iter': ['test-iter.cc', 'hb-static.cc'], + 'test-machinery': ['test-machinery.cc', 'hb-static.cc'], 'test-map': ['test-map.cc', 'hb-static.cc'], + 'test-multimap': ['test-multimap.cc', 'hb-static.cc'], 'test-number': ['test-number.cc', 'hb-number.cc'], 'test-ot-tag': ['hb-ot-tag.cc'], + 'test-priority-queue': ['test-priority-queue.cc', 'hb-static.cc'], + 'test-repacker': ['test-repacker.cc', 'hb-static.cc', 'graph/gsubgpos-context.cc'], + 'test-classdef-graph': ['graph/test-classdef-graph.cc', 'hb-static.cc', 'graph/gsubgpos-context.cc'], 'test-set': ['test-set.cc', 'hb-static.cc'], + 'test-serialize': ['test-serialize.cc', 'hb-static.cc'], 'test-unicode-ranges': ['test-unicode-ranges.cc'], 'test-vector': ['test-vector.cc', 'hb-static.cc'], 'test-bimap': ['test-bimap.cc', 'hb-static.cc'], } foreach name, source : compiled_tests - if cpp.get_id() == 'msvc' and source.contains('hb-static.cc') + if cpp.get_argument_syntax() == 'msvc' and source.contains('hb-static.cc') # TODO: MSVC doesn't like tests having hb-static.cc, fix them continue endif @@ -562,14 +677,14 @@ endif have_gobject = conf.get('HAVE_GOBJECT', 0) == 1 cmake_config = configuration_data() -cmake_config.set('libdir', '${prefix}/@0@'.format(get_option('libdir'))) -cmake_config.set('includedir', '${prefix}/@0@'.format(get_option('includedir'))) +cmake_config.set('libdir', get_option('prefix') / get_option('libdir')) +cmake_config.set('includedir', get_option('prefix') / get_option('includedir')) cmake_config.set('HB_LIBTOOL_VERSION_INFO', hb_libtool_version_info) cmake_config.set('have_gobject', '@0@'.format(have_gobject)) configure_file(input: 'harfbuzz-config.cmake.in', output: 'harfbuzz-config.cmake', configuration: cmake_config, - install_dir: join_paths(get_option('libdir'), 'cmake', 'harfbuzz'), + install_dir: get_option('libdir') / 'cmake' / 'harfbuzz', ) libharfbuzz_gobject_dep = null_dep @@ -579,14 +694,12 @@ if have_gobject h_templ = configure_file( input: 'hb-gobject-enums.h.tmpl', output: 'hb-gobject-enums-tmp.h.tmpl', - configuration: configuration_data(), - format: 'cmake') + copy: true) cc_templ = configure_file( input: 'hb-gobject-enums.cc.tmpl', output: 'hb-gobject-enums-tmp.cc.tmpl', - configuration: configuration_data(), - format: 'cmake') + copy: true) enums = gnome.mkenums('hb-gobject', sources: hb_headers, @@ -607,7 +720,7 @@ if have_gobject output: 'hb-gobject-enums.h', command: [find_program('fix_get_types.py'), '@INPUT@', '@OUTPUT@'], install: true, - install_dir: join_paths(get_option('prefix'), get_option('includedir'), meson.project_name()), + install_dir: get_option('prefix') / get_option('includedir') / meson.project_name(), ) hb_gobject_sources += [enum_c] @@ -647,7 +760,7 @@ if have_gobject nsversion: '0.0', identifier_prefix: 'hb_', symbol_prefix: ['hb', 'hb_gobject'], - includes: ['GObject-2.0'], + includes: ['GObject-2.0', 'freetype2-2.0'], export_packages: ['harfbuzz-gobject'], header: 'hb-gobject.h', install: true, @@ -658,16 +771,10 @@ if have_gobject '--cflags-end']) endif - if build_gir - libharfbuzz_gobject_sources = hb_gen_files_gir - else - libharfbuzz_gobject_sources = hb_gobject_sources - endif - libharfbuzz_gobject_dep = declare_dependency( link_with: libharfbuzz_gobject, include_directories: incsrc, - sources: libharfbuzz_gobject_sources, + sources: build_gir ? hb_gen_files_gir : hb_gobject_sources, dependencies: [glib_dep, gobject_dep]) pkgmod.generate(libharfbuzz_gobject, @@ -694,6 +801,7 @@ if get_option('tests').enabled() env = environment() env.set('srcdir', meson.current_source_dir()) + env.set('base_srcdir', meson.source_root()) env.set('builddir', meson.current_build_dir()) env.set('libs', meson.current_build_dir()) # TODO: Merge this with builddir after autotools removal HBSOURCES = [] @@ -707,22 +815,14 @@ if get_option('tests').enabled() endforeach env.set('HBHEADERS', ' '.join(HBHEADERS)) - if cpp.get_id() != 'msvc' and not meson.is_cross_build() # ensure the local tools are usable - if meson.version().version_compare('>=0.55') - dist_check_script += 'check-libstdc++' - endif - dist_check_script += ['check-static-inits', 'check-symbols'] + if cpp.get_argument_syntax() != 'msvc' and not meson.is_cross_build() # ensure the local tools are usable + dist_check_script += ['check-libstdc++', 'check-static-inits', 'check-symbols'] endif foreach name : dist_check_script - if name == 'check-symbols' - test_depends = defs_list - else - test_depends = [] - endif test(name, find_program(name + '.py'), env: env, - depends: test_depends, + depends: name == 'check-symbols' ? defs_list : [], suite: ['src'], ) endforeach |