From aa3450cac148280f747fb88864b6fcc4ec70cc51 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 17 Jun 2019 22:41:49 -0700 Subject: [PATCH] [config] Don't compile disabled features This makes it possible to include all .cc files into build, even if not building CoreText, Uniscribe, etc. This was mostly to help custom builders. But also means that we can include all files in our own build system. Not sure if we should. Definitely simplifies things, but slightly only. --- src/Makefile.am | 1 + src/hb-coretext.cc | 6 ++++++ src/hb-directwrite.cc | 6 ++++++ src/hb-ft.cc | 5 +++++ src/hb-glib.cc | 5 +++++ src/hb-gobject-enums.cc.tmpl | 7 +++++++ src/hb-gobject-structs.cc | 5 +++++ src/hb-graphite2.cc | 7 +++++++ src/hb-icu.cc | 5 +++++ src/hb-uniscribe.cc | 4 ++++ 10 files changed, 51 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 016229b34..14cafb833 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -424,6 +424,7 @@ HarfBuzz_0_0_gir_CFLAGS = \ -DHB_AAT_H_IN \ -DHB_GOBJECT_H \ -DHB_GOBJECT_H_IN \ + -DHAVE_GOBJECT \ -DHB_EXTERN= \ $(NULL) HarfBuzz_0_0_gir_LIBS = \ diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index 85993d196..20cfe4a60 100644 --- a/src/hb-coretext.cc +++ b/src/hb-coretext.cc @@ -27,6 +27,9 @@ */ #include "hb.hh" + +#ifdef HAVE_CORETEXT + #include "hb-shaper-impl.hh" #include "hb-coretext.h" @@ -1148,3 +1151,6 @@ fail: return ret; } + + +#endif diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index b135c49e9..85ba8b627 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -23,6 +23,9 @@ */ #include "hb.hh" + +#ifdef HAVE_DIRECTWRITE + #include "hb-shaper-impl.hh" #include @@ -958,3 +961,6 @@ hb_directwrite_face_get_font_face (hb_face_t *face) { return face->data.directwrite->fontFace; } + + +#endif diff --git a/src/hb-ft.cc b/src/hb-ft.cc index d40e8fad7..c01f02991 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -29,6 +29,8 @@ #include "hb.hh" +#ifdef HAVE_FREETYPE + #include "hb-ft.h" #include "hb-font.hh" @@ -877,3 +879,6 @@ hb_ft_font_set_funcs (hb_font_t *font) _hb_ft_font_set_funcs (font, ft_face, true); hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING); } + + +#endif diff --git a/src/hb-glib.cc b/src/hb-glib.cc index 576375460..db02b6760 100644 --- a/src/hb-glib.cc +++ b/src/hb-glib.cc @@ -28,6 +28,8 @@ #include "hb.hh" +#ifdef HAVE_GLIB + #include "hb-glib.h" #include "hb-machinery.hh" @@ -404,3 +406,6 @@ hb_glib_blob_create (GBytes *gbytes) _hb_g_bytes_unref); } #endif + + +#endif diff --git a/src/hb-gobject-enums.cc.tmpl b/src/hb-gobject-enums.cc.tmpl index e3a9a6b3f..17f1adeb1 100644 --- a/src/hb-gobject-enums.cc.tmpl +++ b/src/hb-gobject-enums.cc.tmpl @@ -27,6 +27,8 @@ #include "hb.hh" +#ifdef HAVE_GOBJECT + /* g++ didn't like older gtype.h gcc-only code path. */ #include #if !GLIB_CHECK_VERSION(2,29,16) @@ -44,6 +46,11 @@ /* enumerations from "@filename@" */ /*** END file-production ***/ +/*** BEGIN file-tail ***/ + +#endif +/*** END file-tail ***/ + /*** BEGIN value-header ***/ GType @enum_name@_get_type () diff --git a/src/hb-gobject-structs.cc b/src/hb-gobject-structs.cc index 3cff880aa..7f4922ef1 100644 --- a/src/hb-gobject-structs.cc +++ b/src/hb-gobject-structs.cc @@ -26,6 +26,8 @@ #include "hb.hh" +#ifdef HAVE_GOBJECT + /** * SECTION:hb-gobject @@ -94,3 +96,6 @@ HB_DEFINE_VALUE_TYPE (user_data_key) HB_DEFINE_VALUE_TYPE (ot_math_glyph_variant) HB_DEFINE_VALUE_TYPE (ot_math_glyph_part) + + +#endif diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index f799f8b22..9588fa4d6 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -26,6 +26,10 @@ * Google Author(s): Behdad Esfahbod */ +#include "hb.hh" + +#ifdef HAVE_GRAPHITE2 + #include "hb-shaper-impl.hh" #include "hb-graphite2.h" @@ -447,3 +451,6 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED, return true; } + + +#endif diff --git a/src/hb-icu.cc b/src/hb-icu.cc index 399829a81..e98908de7 100644 --- a/src/hb-icu.cc +++ b/src/hb-icu.cc @@ -29,6 +29,8 @@ #include "hb.hh" +#ifdef HAVE_ICU + #include "hb-icu.h" #include "hb-machinery.hh" @@ -351,3 +353,6 @@ hb_icu_get_unicode_funcs () { return static_icu_funcs.get_unconst (); } + + +#endif diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 69a1ae7e4..fceda5244 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -25,6 +25,9 @@ */ #include "hb.hh" + +#ifdef HAVE_UNISCRIBE + #include "hb-shaper-impl.hh" #include @@ -1023,3 +1026,4 @@ retry: } +#endif