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
15!if "$(CFG)" == "debug"
16FREETYPE_LIB = freetyped.lib
17!else
18FREETYPE_LIB = freetype.lib
19!endif
20
21# Cairo is needed for building hb-view
22CAIRO_LIB = cairo.lib
23
24# Graphite2 is needed for building SIL Graphite2 support
25GRAPHITE2_LIB = graphite2.lib
26
27# Uniscribe is needed for Uniscribe shaping support
28UNISCRIBE_LIB = usp10.lib gdi32.lib rpcrt4.lib user32.lib
29
30# Directwrite is needed for DirectWrite shaping support
31DIRECTWRITE_LIB = dwrite.lib
32
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
35HB_DEFINES =
36HB_CFLAGS = /DHAVE_CONFIG_H
37HB_UCDN_CFLAGS = /I..\src\hb-ucdn
38HB_SOURCES =	\
39	$(HB_BASE_sources)		\
40	$(HB_FALLBACK_sources)	\
41	$(HB_OT_sources)
42
43HB_HEADERS =	\
44	$(HB_BASE_headers)		\
45	$(HB_NODIST_headers)	\
46	$(HB_OT_headers)
47
48# Minimal set of (system) libraries needed for the HarfBuzz DLL
49HB_DEP_LIBS =
50
51# We build the HarfBuzz DLL/LIB at least
52HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib
53
54# Note: All the utility and test programs require GLib support to be present!
55HB_UTILS =
56HB_UTILS_DEP_LIBS = $(HB_GLIB_LIBS)
57HB_TESTS =
58HB_TESTS_DEP_LIBS = $(HB_GLIB_LIBS)
59
60# Use libtool-style DLL names, if desired
61!if "$(LIBTOOL_DLL_NAME)" == "1"
62HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-0
63HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-gobject-0
64!else
65HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-vs$(VSVER)
66HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-gobject-vs$(VSVER)
67!endif
68
69# Enable Introspection (enables HarfBuzz-Gobject as well)
70!if "$(INTROSPECTION)" == "1"
71GOBJECT = 1
72CHECK_PACKAGE = gobject-2.0
73EXTRA_TARGETS = $(CFG)\$(PLAT)\HarfBuzz-0.0.gir $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib
74!else
75EXTRA_TARGETS =
76!endif
77
78# Enable HarfBuzz-GObject (enables GLib support as well)
79!if "$(GOBJECT)" == "1"
80GLIB = 1
81HB_LIBS =	\
82	$(HB_LIBS)	\
83	$(CFG)\$(PLAT)\harfbuzz-gobject.lib
84
85HB_GOBJECT_ENUM_GENERATED_SOURCES = \
86	$(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc	\
87	$(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h
88
89!endif
90
91# Enable cairo-ft (enables cairo and freetype as well)
92!if "$(CAIRO_FT)" == "1"
93HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO_FT=1
94CAIRO = 1
95FREETYPE = 1
96!if "$(GLIB)" == "1"
97HB_UTILS = \
98	$(HB_UTILS)	\
99	$(CFG)\$(PLAT)\hb-view.exe
100
101HB_UTILS_DEP_LIBS = $(HB_UTILS_DEP_LIBS) $(CAIRO_LIB) $(FREETYPE_LIB)
102!else
103!if [echo Warning: GLib support not enabled, hb-view not built]
104!endif
105!endif
106!endif
107
108# Enable cairo
109!if "$(CAIRO)" == "1"
110HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1
111!endif
112
113# Enable freetype if desired
114!if "$(FREETYPE)" == "1"
115!if "$(FREETYPE_DIR)" != ""
116HB_CFLAGS = $(HB_CFLAGS) /I$(FREETYPE_DIR)
117!endif
118HB_DEFINES = $(HB_DEFINES) /DHAVE_FREETYPE=1
119HB_SOURCES = $(HB_SOURCES) $(HB_FT_sources)
120HB_HEADERS = $(HB_HEADERS) $(HB_FT_headers)
121HB_DEP_LIBS = $(HB_DEP_LIBS) $(FREETYPE_LIB)
122!endif
123
124# Enable graphite2 if desired
125!if "$(GRAPHITE2)" == "1"
126HB_DEFINES = $(HB_DEFINES) /DHAVE_GRAPHITE2=1
127HB_SOURCES = $(HB_SOURCES) $(HB_GRAPHITE2_sources)
128HB_HEADERS = $(HB_HEADERS) $(HB_GRAPHITE2_headers)
129HB_DEP_LIBS = $(HB_DEP_LIBS) $(GRAPHITE2_LIB)
130!endif
131
132# Enable GLib if desired
133!if "$(GLIB)" == "1"
134HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
135HB_CFLAGS =	\
136	$(HB_CFLAGS)					\
137	/FImsvc_recommended_pragmas.h	\
138	/I$(PREFIX)\include\glib-2.0	\
139	/I$(PREFIX)\lib\glib-2.0\include
140
141HB_SOURCES = $(HB_SOURCES) $(HB_GLIB_sources)
142HB_HEADERS = $(HB_HEADERS) $(HB_GLIB_headers)
143HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_GLIB_LIBS)
144
145HB_UTILS = \
146	$(HB_UTILS)					\
147	$(CFG)\$(PLAT)\hb-shape.exe	\
148	$(CFG)\$(PLAT)\hb-ot-shape-closure.exe
149
150HB_TESTS = \
151	$(HB_TESTS)	\
152	$(CFG)\$(PLAT)\main.exe						\
153	$(CFG)\$(PLAT)\test.exe						\
154	$(CFG)\$(PLAT)\test-buffer-serialize.exe	\
155	$(CFG)\$(PLAT)\test-size-params.exe			\
156	$(CFG)\$(PLAT)\test-would-substitute.exe	\
157	$(CFG)\$(PLAT)\test-blob.exe				\
158	$(CFG)\$(PLAT)\test-buffer.exe				\
159	$(CFG)\$(PLAT)\test-common.exe				\
160	$(CFG)\$(PLAT)\test-font.exe				\
161	$(CFG)\$(PLAT)\test-object.exe				\
162	$(CFG)\$(PLAT)\test-set.exe					\
163	$(CFG)\$(PLAT)\test-shape.exe				\
164	$(CFG)\$(PLAT)\test-unicode.exe				\
165	$(CFG)\$(PLAT)\test-version.exe
166
167!elseif "$(ICU)" == "1"
168# use ICU for Unicode functions
169# and define some of the macros in GLib's msvc_recommended_pragmas.h
170# to reduce some unneeded build-time warnings
171HB_DEFINES = $(HB_DEFINES) /DHAVE_ICU=1 /DHAVE_ICU_BUILTIN=1
172HB_CFLAGS =	\
173	$(HB_CFLAGS)					\
174	/wd4244							\
175	/D_CRT_SECURE_NO_WARNINGS		\
176	/D_CRT_NONSTDC_NO_WARNINGS
177
178# We don't want ICU to re-define int8_t in VS 2008, will cause build breakage
179# as we define it in hb-common.h, and we ought to use the definitions there.
180!if "$(VSVER)" == "9"
181HB_CFLAGS =	$(HB_CFLAGS) /DU_HAVE_INT8_T
182!endif
183
184HB_SOURCES = $(HB_SOURCES) $(HB_ICU_sources)
185HB_HEADERS = $(HB_HEADERS) $(HB_ICU_headers)
186HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_ICU_DEP_LIBS)
187!endif
188
189!if "$(UCDN)" != "0"
190# Define some of the macros in GLib's msvc_recommended_pragmas.h
191# to reduce some unneeded build-time warnings
192HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
193HB_CFLAGS =	\
194	$(HB_CFLAGS)					\
195	$(HB_UCDN_CFLAGS)				\
196	/wd4244							\
197	/D_CRT_SECURE_NO_WARNINGS		\
198	/D_CRT_NONSTDC_NO_WARNINGS
199
200HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
201!endif
202
203!if "$(UNISCRIBE)" == "1"
204HB_CFLAGS = $(HB_CFLAGS) /DHAVE_UNISCRIBE
205HB_SOURCES = $(HB_SOURCES) $(HB_UNISCRIBE_sources)
206HB_HEADERS = $(HB_HEADERS) $(HB_UNISCRIBE_headers)
207HB_DEP_LIBS = $(HB_DEP_LIBS) $(UNISCRIBE_LIB)
208!endif
209
210!if "$(DIRECTWRITE)" == "1"
211HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE
212HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources)
213HB_HEADERS = $(HB_HEADERS) $(HB_DIRECTWRITE_headers)
214HB_DEP_LIBS = $(HB_DEP_LIBS) $(DIRECTWRITE_LIB)
215!endif
216
217HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern"
218