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 FREETYPE_LIB = freetype.lib
17 # Cairo is needed for building hb-view
20 # Graphite2 is needed for building SIL Graphite2 support
21 GRAPHITE2_LIB = graphite2.lib
23 # Directwrite is needed for DirectWrite shaping support
24 DIRECTWRITE_LIB = dwrite.lib
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
29 HB_CFLAGS = /DHAVE_CONFIG_H
30 HB_UCDN_CFLAGS = /I..\src\hb-ucdn
33 $(HB_FALLBACK_sources) \
35 $(HB_UNISCRIBE_sources) \
39 $(HB_NODIST_headers) \
41 $(HB_UNISCRIBE_headers)
43 # Minimal set of (system) libraries needed for the HarfBuzz DLL
44 HB_DEP_LIBS = usp10.lib gdi32.lib rpcrt4.lib user32.lib
46 # We build the HarfBuzz DLL/LIB at least
47 HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib
49 # Note: All the utility and test programs require GLib support to be present!
51 HB_UTILS_DEP_LIBS = $(HB_GLIB_LIBS)
53 HB_TESTS_DEP_LIBS = $(HB_GLIB_LIBS)
55 # Use libtool-style DLL names, if desired
56 !if "$(LIBTOOL_DLL_NAME)" == "1"
57 HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-0
58 HARFBUZZ_ICU_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-icu-0
59 HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-gobject-0
61 HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-vs$(VSVER)
62 HARFBUZZ_ICU_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-icu-vs$(VSVER)
63 HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-gobject-vs$(VSVER)
66 # Enable HarfBuzz-ICU, if desired
71 $(CFG)\$(PLAT)\harfbuzz-icu.lib
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.
76 HB_ICU_CFLAGS = /DU_HAVE_INT8_T
81 # Enable Introspection (enables HarfBuzz-Gobject as well)
82 !if "$(INTROSPECTION)" == "1"
84 CHECK_PACKAGE = gobject-2.0
85 EXTRA_TARGETS = $(CFG)\$(PLAT)\HarfBuzz-0.0.gir $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib
90 # Enable HarfBuzz-GObject (enables GLib support as well)
91 !if "$(GOBJECT)" == "1"
95 $(CFG)\$(PLAT)\harfbuzz-gobject.lib
97 HB_GOBJECT_ENUM_GENERATED_SOURCES = \
98 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc \
99 $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h
103 # Enable cairo-ft (enables cairo and freetype as well)
104 !if "$(CAIRO_FT)" == "1"
105 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO_FT=1
111 $(CFG)\$(PLAT)\hb-view.exe
113 HB_UTILS_DEP_LIBS = $(HB_UTILS_DEP_LIBS) $(CAIRO_LIB) $(FREETYPE_LIB)
115 !if [echo Warning: GLib support not enabled, hb-view not built]
121 !if "$(CAIRO)" == "1"
122 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1
125 # Enable freetype if desired
126 !if "$(FREETYPE)" == "1"
127 HB_DEFINES = $(HB_DEFINES) /DHAVE_FREETYPE=1
128 HB_SOURCES = $(HB_SOURCES) $(HB_FT_sources)
129 HB_HEADERS = $(HB_HEADERS) $(HB_FT_headers)
130 HB_DEP_LIBS = $(HB_DEP_LIBS) $(FREETYPE_LIB)
133 # Enable graphite2 if desired
134 !if "$(GRAPHITE2)" == "1"
135 HB_DEFINES = $(HB_DEFINES) /DHAVE_GRAPHITE2=1
136 HB_SOURCES = $(HB_SOURCES) $(HB_GRAPHITE2_sources)
137 HB_HEADERS = $(HB_HEADERS) $(HB_GRAPHITE2_headers)
138 HB_DEP_LIBS = $(HB_DEP_LIBS) $(GRAPHITE2_LIB)
141 # Enable GLib if desired
143 HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
146 /FImsvc_recommended_pragmas.h \
147 /I$(PREFIX)\include\glib-2.0 \
148 /I$(PREFIX)\lib\glib-2.0\include
150 HB_SOURCES = $(HB_SOURCES) $(HB_GLIB_sources)
151 HB_HEADERS = $(HB_HEADERS) $(HB_GLIB_headers)
152 HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_GLIB_LIBS)
156 $(CFG)\$(PLAT)\hb-shape.exe \
157 $(CFG)\$(PLAT)\hb-ot-shape-closure.exe
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
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
180 HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
185 /D_CRT_SECURE_NO_WARNINGS \
186 /D_CRT_NONSTDC_NO_WARNINGS
188 HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
191 !if "$(DIRECTWRITE)" == "1"
192 HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE
193 HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources)
194 HB_HEADERS = $(HB_HEADERS) $(HB_DIRECTWRITE_headers)
195 HB_DEP_LIBS = $(HB_DEP_LIBS) $(DIRECTWRITE_LIB)
198 HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern"