[config] Don't compile disabled features
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 18 Jun 2019 05:41:49 +0000 (22:41 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 18 Jun 2019 05:41:49 +0000 (22:41 -0700)
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
src/hb-coretext.cc
src/hb-directwrite.cc
src/hb-ft.cc
src/hb-glib.cc
src/hb-gobject-enums.cc.tmpl
src/hb-gobject-structs.cc
src/hb-graphite2.cc
src/hb-icu.cc
src/hb-uniscribe.cc

index 016229b..14cafb8 100644 (file)
@@ -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 = \
index 85993d1..20cfe4a 100644 (file)
@@ -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
index b135c49..85ba8b6 100644 (file)
@@ -23,6 +23,9 @@
  */
 
 #include "hb.hh"
+
+#ifdef HAVE_DIRECTWRITE
+
 #include "hb-shaper-impl.hh"
 
 #include <DWrite_1.h>
@@ -958,3 +961,6 @@ hb_directwrite_face_get_font_face (hb_face_t *face)
 {
   return face->data.directwrite->fontFace;
 }
+
+
+#endif
index d40e8fa..c01f029 100644 (file)
@@ -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
index 5763754..db02b67 100644 (file)
@@ -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
index e3a9a6b..17f1ade 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "hb.hh"
 
+#ifdef HAVE_GOBJECT
+
 /* g++ didn't like older gtype.h gcc-only code path. */
 #include <glib.h>
 #if !GLIB_CHECK_VERSION(2,29,16)
 /* enumerations from "@filename@" */
 /*** END file-production ***/
 
+/*** BEGIN file-tail ***/
+
+#endif
+/*** END file-tail ***/
+
 /*** BEGIN value-header ***/
 GType
 @enum_name@_get_type ()
index 3cff880..7f4922e 100644 (file)
@@ -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
index f799f8b..9588fa4 100644 (file)
  * 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
index 399829a..e98908d 100644 (file)
@@ -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
index 69a1ae7..fceda52 100644 (file)
@@ -25,6 +25,9 @@
  */
 
 #include "hb.hh"
+
+#ifdef HAVE_UNISCRIBE
+
 #include "hb-shaper-impl.hh"
 
 #include <windows.h>
@@ -1023,3 +1026,4 @@ retry:
 }
 
 
+#endif