1# NMake Makefile portion for enabling features for Windows builds 2 3# You may change these lines to customize the .lib files that will be linked to 4# Additional Libraries for building HarfBuzz-ICU 5# icudt.lib may be required for static ICU builds 6HB_ICU_DEP_LIBS = icuuc.lib 7 8# GLib is required for all utility programs and tests 9HB_GLIB_LIBS = glib-2.0.lib 10 11# Needed for building HarfBuzz-GObject 12HB_GOBJECT_DEP_LIBS = gobject-2.0.lib $(HB_GLIB_LIBS) 13 14# Freetype is needed for building FreeType support and hb-view 15FREETYPE_LIB = freetype.lib 16 17# Cairo is needed for building hb-view 18CAIRO_LIB = cairo.lib 19 20# Graphite2 is needed for building SIL Graphite2 support 21GRAPHITE2_LIB = graphite2.lib 22 23# Directwrite is needed for DirectWrite shaping support 24DIRECTWRITE_LIB = dwrite.lib 25 26# Please do not change anything beneath this line unless maintaining the NMake Makefiles 27# Bare minimum features and sources built into HarfBuzz on Windows 28HB_DEFINES = 29HB_CFLAGS = /DHAVE_CONFIG_H 30HB_UCDN_CFLAGS = /I..\src\hb-ucdn 31HB_SOURCES = \ 32 $(HB_BASE_sources) \ 33 $(HB_FALLBACK_sources) \ 34 $(HB_OT_sources) \ 35 $(HB_UNISCRIBE_sources) \ 36 37HB_HEADERS = \ 38 $(HB_BASE_headers) \ 39 $(HB_NODIST_headers) \ 40 $(HB_OT_headers) \ 41 $(HB_UNISCRIBE_headers) 42 43# Minimal set of (system) libraries needed for the HarfBuzz DLL 44HB_DEP_LIBS = usp10.lib gdi32.lib rpcrt4.lib user32.lib 45 46# We build the HarfBuzz DLL/LIB at least 47HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib 48 49# Note: All the utility and test programs require GLib support to be present! 50HB_UTILS = 51HB_UTILS_DEP_LIBS = $(HB_GLIB_LIBS) 52HB_TESTS = 53HB_TESTS_DEP_LIBS = $(HB_GLIB_LIBS) 54 55# Use libtool-style DLL names, if desired 56!if "$(LIBTOOL_DLL_NAME)" == "1" 57HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-0 58HARFBUZZ_ICU_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-icu-0 59HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-gobject-0 60!else 61HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-vs$(VSVER) 62HARFBUZZ_ICU_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-icu-vs$(VSVER) 63HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-gobject-vs$(VSVER) 64!endif 65 66# Enable HarfBuzz-ICU, if desired 67!if "$(ICU)" == "1" 68HB_ICU_CFLAGS = 69HB_LIBS = \ 70 $(HB_LIBS) \ 71 $(CFG)\$(PLAT)\harfbuzz-icu.lib 72 73# We don't want to re-define int8_t Visual Studio 2008, will cause build breakage 74# as we define it in hb-common.h, and we ought to use the definitions there. 75!if "$(VSVER)" == "9" 76HB_ICU_CFLAGS = /DU_HAVE_INT8_T 77!endif 78 79!endif 80 81# Enable Introspection (enables HarfBuzz-Gobject as well) 82!if "$(INTROSPECTION)" == "1" 83GOBJECT = 1 84CHECK_PACKAGE = gobject-2.0 85EXTRA_TARGETS = $(CFG)\$(PLAT)\HarfBuzz-0.0.gir $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib 86!else 87EXTRA_TARGETS = 88!endif 89 90# Enable HarfBuzz-GObject (enables GLib support as well) 91!if "$(GOBJECT)" == "1" 92GLIB = 1 93HB_LIBS = \ 94 $(HB_LIBS) \ 95 $(CFG)\$(PLAT)\harfbuzz-gobject.lib 96 97HB_GOBJECT_ENUM_GENERATED_SOURCES = \ 98 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc \ 99 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h 100 101!endif 102 103# Enable cairo-ft (enables cairo and freetype as well) 104!if "$(CAIRO_FT)" == "1" 105HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO_FT=1 106CAIRO = 1 107FREETYPE = 1 108!if "$(GLIB)" == "1" 109HB_UTILS = \ 110 $(HB_UTILS) \ 111 $(CFG)\$(PLAT)\hb-view.exe 112 113HB_UTILS_DEP_LIBS = $(HB_UTILS_DEP_LIBS) $(CAIRO_LIB) $(FREETYPE_LIB) 114!else 115!if [echo Warning: GLib support not enabled, hb-view not built] 116!endif 117!endif 118!endif 119 120# Enable cairo 121!if "$(CAIRO)" == "1" 122HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1 123!endif 124 125# Enable freetype if desired 126!if "$(FREETYPE)" == "1" 127HB_DEFINES = $(HB_DEFINES) /DHAVE_FREETYPE=1 128HB_SOURCES = $(HB_SOURCES) $(HB_FT_sources) 129HB_HEADERS = $(HB_HEADERS) $(HB_FT_headers) 130HB_DEP_LIBS = $(HB_DEP_LIBS) $(FREETYPE_LIB) 131!endif 132 133# Enable graphite2 if desired 134!if "$(GRAPHITE2)" == "1" 135HB_DEFINES = $(HB_DEFINES) /DHAVE_GRAPHITE2=1 136HB_SOURCES = $(HB_SOURCES) $(HB_GRAPHITE2_sources) 137HB_HEADERS = $(HB_HEADERS) $(HB_GRAPHITE2_headers) 138HB_DEP_LIBS = $(HB_DEP_LIBS) $(GRAPHITE2_LIB) 139!endif 140 141# Enable GLib if desired 142!if "$(GLIB)" == "1" 143HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1 144HB_CFLAGS = \ 145 $(HB_CFLAGS) \ 146 /FImsvc_recommended_pragmas.h \ 147 /I$(PREFIX)\include\glib-2.0 \ 148 /I$(PREFIX)\lib\glib-2.0\include 149 150HB_SOURCES = $(HB_SOURCES) $(HB_GLIB_sources) 151HB_HEADERS = $(HB_HEADERS) $(HB_GLIB_headers) 152HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_GLIB_LIBS) 153 154HB_UTILS = \ 155 $(HB_UTILS) \ 156 $(CFG)\$(PLAT)\hb-shape.exe \ 157 $(CFG)\$(PLAT)\hb-ot-shape-closure.exe 158 159HB_TESTS = \ 160 $(HB_TESTS) \ 161 $(CFG)\$(PLAT)\main.exe \ 162 $(CFG)\$(PLAT)\test.exe \ 163 $(CFG)\$(PLAT)\test-buffer-serialize.exe \ 164 $(CFG)\$(PLAT)\test-size-params.exe \ 165 $(CFG)\$(PLAT)\test-would-substitute.exe \ 166 $(CFG)\$(PLAT)\test-blob.exe \ 167 $(CFG)\$(PLAT)\test-buffer.exe \ 168 $(CFG)\$(PLAT)\test-common.exe \ 169 $(CFG)\$(PLAT)\test-font.exe \ 170 $(CFG)\$(PLAT)\test-object.exe \ 171 $(CFG)\$(PLAT)\test-set.exe \ 172 $(CFG)\$(PLAT)\test-shape.exe \ 173 $(CFG)\$(PLAT)\test-unicode.exe \ 174 $(CFG)\$(PLAT)\test-version.exe 175 176!else 177# If there is no GLib support, use the built-in UCDN 178# and define some of the macros in GLib's msvc_recommended_pragmas.h 179# to reduce some unneeded build-time warnings 180HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1 181HB_CFLAGS = \ 182 $(HB_CFLAGS) \ 183 $(HB_UCDN_CFLAGS) \ 184 /wd4244 \ 185 /D_CRT_SECURE_NO_WARNINGS \ 186 /D_CRT_NONSTDC_NO_WARNINGS 187 188HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources) 189!endif 190 191!if "$(DIRECTWRITE)" == "1" 192HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE 193HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources) 194HB_HEADERS = $(HB_HEADERS) $(HB_DIRECTWRITE_headers) 195HB_DEP_LIBS = $(HB_DEP_LIBS) $(DIRECTWRITE_LIB) 196!endif 197 198HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern" 199