1 # NMake Makefile portion for enabling features for Windows builds
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
6 HB_ICU_DEP_LIBS = icuuc.lib
8 # GLib is required for all utility programs and tests
9 HB_GLIB_LIBS = glib-2.0.lib
11 # Needed for building HarfBuzz-GObject
12 HB_GOBJECT_DEP_LIBS = gobject-2.0.lib $(HB_GLIB_LIBS)
14 # Freetype is needed for building FreeType support and hb-view
15 !if "$(CFG)" == "debug"
16 FREETYPE_LIB = freetyped.lib
18 FREETYPE_LIB = freetype.lib
21 # Cairo is needed for building hb-view
24 # Graphite2 is needed for building SIL Graphite2 support
25 GRAPHITE2_LIB = graphite2.lib
27 # Uniscribe is needed for Uniscribe shaping support
28 UNISCRIBE_LIB = usp10.lib gdi32.lib rpcrt4.lib user32.lib
30 # Directwrite is needed for DirectWrite shaping support
31 DIRECTWRITE_LIB = dwrite.lib
33 # Please do not change anything beneath this line unless maintaining the NMake Makefiles
34 # Bare minimum features and sources built into HarfBuzz on Windows
36 HB_CFLAGS = /DHAVE_CONFIG_H
37 HB_UCDN_CFLAGS = /I..\src\hb-ucdn
40 $(HB_BASE_RAGEL_GENERATED_sources) \
41 $(HB_FALLBACK_sources) \
43 $(HB_OT_RAGEL_GENERATED_sources)
48 $(HB_NODIST_headers) \
51 # Minimal set of (system) libraries needed for the HarfBuzz DLL
54 # We build the HarfBuzz DLL/LIB at least
55 HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib
57 # Note: All the utility and test programs require GLib support to be present!
59 HB_UTILS_DEP_LIBS = $(HB_GLIB_LIBS)
61 HB_TESTS_DEP_LIBS = $(HB_GLIB_LIBS)
63 # Use libtool-style DLL names, if desired
64 !if "$(LIBTOOL_DLL_NAME)" == "1"
65 HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-0
66 HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-gobject-0
68 HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-vs$(VSVER)
69 HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-gobject-vs$(VSVER)
72 # Enable Introspection (enables HarfBuzz-Gobject as well)
73 !if "$(INTROSPECTION)" == "1"
75 CHECK_PACKAGE = gobject-2.0
76 EXTRA_TARGETS = $(CFG)\$(PLAT)\HarfBuzz-0.0.gir $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib
81 # Enable HarfBuzz-GObject (enables GLib support as well)
82 !if "$(GOBJECT)" == "1"
86 $(CFG)\$(PLAT)\harfbuzz-gobject.lib
88 HB_GOBJECT_ENUM_GENERATED_SOURCES = \
89 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc \
90 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h
94 # Enable cairo-ft (enables cairo and freetype as well)
95 !if "$(CAIRO_FT)" == "1"
96 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO_FT=1
102 $(CFG)\$(PLAT)\hb-view.exe
104 HB_UTILS_DEP_LIBS = $(HB_UTILS_DEP_LIBS) $(CAIRO_LIB) $(FREETYPE_LIB)
106 !if [echo Warning: GLib support not enabled, hb-view not built]
112 !if "$(CAIRO)" == "1"
113 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1
116 # Enable freetype if desired
117 !if "$(FREETYPE)" == "1"
118 !if "$(FREETYPE_DIR)" != ""
119 HB_CFLAGS = $(HB_CFLAGS) /I$(FREETYPE_DIR)
121 HB_DEFINES = $(HB_DEFINES) /DHAVE_FREETYPE=1
122 HB_SOURCES = $(HB_SOURCES) $(HB_FT_sources)
123 HB_HEADERS = $(HB_HEADERS) $(HB_FT_headers)
124 HB_DEP_LIBS = $(HB_DEP_LIBS) $(FREETYPE_LIB)
127 # Enable graphite2 if desired
128 !if "$(GRAPHITE2)" == "1"
129 HB_DEFINES = $(HB_DEFINES) /DHAVE_GRAPHITE2=1
130 HB_SOURCES = $(HB_SOURCES) $(HB_GRAPHITE2_sources)
131 HB_HEADERS = $(HB_HEADERS) $(HB_GRAPHITE2_headers)
132 HB_DEP_LIBS = $(HB_DEP_LIBS) $(GRAPHITE2_LIB)
135 # Always enable UCDN unless explicitly disabled
136 !if "$(NO_UCDN)" != "1"
137 HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
142 HB_SOURCES = $(HB_SOURCES) $(hb_ucdn_SRCS) $(HB_UCDN_sources)
145 # Enable GLib if desired
147 HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
150 /FImsvc_recommended_pragmas.h \
151 /I$(PREFIX)\include\glib-2.0 \
152 /I$(PREFIX)\lib\glib-2.0\include
154 HB_SOURCES = $(HB_SOURCES) $(HB_GLIB_sources)
155 HB_HEADERS = $(HB_HEADERS) $(HB_GLIB_headers)
156 HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_GLIB_LIBS)
160 $(CFG)\$(PLAT)\hb-shape.exe \
161 $(CFG)\$(PLAT)\hb-ot-shape-closure.exe
165 $(CFG)\$(PLAT)\main.exe \
166 $(CFG)\$(PLAT)\test.exe \
167 $(CFG)\$(PLAT)\test-buffer-serialize.exe \
168 $(CFG)\$(PLAT)\test-size-params.exe \
169 $(CFG)\$(PLAT)\test-would-substitute.exe \
170 $(CFG)\$(PLAT)\test-blob.exe \
171 $(CFG)\$(PLAT)\test-buffer.exe \
172 $(CFG)\$(PLAT)\test-common.exe \
173 $(CFG)\$(PLAT)\test-font.exe \
174 $(CFG)\$(PLAT)\test-object.exe \
175 $(CFG)\$(PLAT)\test-set.exe \
176 $(CFG)\$(PLAT)\test-shape.exe \
177 $(CFG)\$(PLAT)\test-unicode.exe \
178 $(CFG)\$(PLAT)\test-version.exe
182 # Define some of the macros in GLib's msvc_recommended_pragmas.h
183 # to reduce some unneeded build-time warnings
187 /D_CRT_SECURE_NO_WARNINGS \
188 /D_CRT_NONSTDC_NO_WARNINGS
193 # use ICU for Unicode functions
194 # and define some of the macros in GLib's msvc_recommended_pragmas.h
195 # to reduce some unneeded build-time warnings
196 HB_DEFINES = $(HB_DEFINES) /DHAVE_ICU=1 /DHAVE_ICU_BUILTIN=1
198 # We don't want ICU to re-define int8_t in VS 2008, will cause build breakage
199 # as we define it in hb-common.h, and we ought to use the definitions there.
200 !if "$(VSVER)" == "9"
201 HB_CFLAGS = $(HB_CFLAGS) /DU_HAVE_INT8_T
204 HB_SOURCES = $(HB_SOURCES) $(HB_ICU_sources)
205 HB_HEADERS = $(HB_HEADERS) $(HB_ICU_headers)
206 HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_ICU_DEP_LIBS)
209 !if "$(UNISCRIBE)" == "1"
210 HB_CFLAGS = $(HB_CFLAGS) /DHAVE_UNISCRIBE
211 HB_SOURCES = $(HB_SOURCES) $(HB_UNISCRIBE_sources)
212 HB_HEADERS = $(HB_HEADERS) $(HB_UNISCRIBE_headers)
213 HB_DEP_LIBS = $(HB_DEP_LIBS) $(UNISCRIBE_LIB)
216 !if "$(DIRECTWRITE)" == "1"
217 HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE
218 HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources)
219 HB_HEADERS = $(HB_HEADERS) $(HB_DIRECTWRITE_headers)
220 HB_DEP_LIBS = $(HB_DEP_LIBS) $(DIRECTWRITE_LIB)
223 HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern"