Imported Upstream version 1.4.6
[platform/upstream/harfbuzz.git] / win32 / config-msvc.mak
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
6 HB_ICU_DEP_LIBS = icuuc.lib
7
8 # GLib is required for all utility programs and tests
9 HB_GLIB_LIBS = glib-2.0.lib
10
11 # Needed for building HarfBuzz-GObject
12 HB_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"
16 FREETYPE_LIB = freetyped.lib
17 !else
18 FREETYPE_LIB = freetype.lib
19 !endif
20
21 # Cairo is needed for building hb-view
22 CAIRO_LIB = cairo.lib
23
24 # Graphite2 is needed for building SIL Graphite2 support
25 GRAPHITE2_LIB = graphite2.lib
26
27 # Uniscribe is needed for Uniscribe shaping support
28 UNISCRIBE_LIB = usp10.lib gdi32.lib rpcrt4.lib user32.lib
29
30 # Directwrite is needed for DirectWrite shaping support
31 DIRECTWRITE_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
35 HB_DEFINES =
36 HB_CFLAGS = /DHAVE_CONFIG_H
37 HB_UCDN_CFLAGS = /I..\src\hb-ucdn
38 HB_SOURCES =    \
39         $(HB_BASE_sources)                      \
40         $(HB_BASE_RAGEL_GENERATED_sources)      \
41         $(HB_FALLBACK_sources)                  \
42         $(HB_OT_sources)                        \
43         $(HB_OT_RAGEL_GENERATED_sources)
44
45
46 HB_HEADERS =    \
47         $(HB_BASE_headers)              \
48         $(HB_NODIST_headers)    \
49         $(HB_OT_headers)
50
51 # Minimal set of (system) libraries needed for the HarfBuzz DLL
52 HB_DEP_LIBS =
53
54 # We build the HarfBuzz DLL/LIB at least
55 HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib
56
57 # Note: All the utility and test programs require GLib support to be present!
58 HB_UTILS =
59 HB_UTILS_DEP_LIBS = $(HB_GLIB_LIBS)
60 HB_TESTS =
61 HB_TESTS_DEP_LIBS = $(HB_GLIB_LIBS)
62
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
67 !else
68 HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-vs$(VSVER)
69 HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-gobject-vs$(VSVER)
70 !endif
71
72 # Enable Introspection (enables HarfBuzz-Gobject as well)
73 !if "$(INTROSPECTION)" == "1"
74 GOBJECT = 1
75 CHECK_PACKAGE = gobject-2.0
76 EXTRA_TARGETS = $(CFG)\$(PLAT)\HarfBuzz-0.0.gir $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib
77 !else
78 EXTRA_TARGETS =
79 !endif
80
81 # Enable HarfBuzz-GObject (enables GLib support as well)
82 !if "$(GOBJECT)" == "1"
83 GLIB = 1
84 HB_LIBS =       \
85         $(HB_LIBS)      \
86         $(CFG)\$(PLAT)\harfbuzz-gobject.lib
87
88 HB_GOBJECT_ENUM_GENERATED_SOURCES = \
89         $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc     \
90         $(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h
91
92 !endif
93
94 # Enable cairo-ft (enables cairo and freetype as well)
95 !if "$(CAIRO_FT)" == "1"
96 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO_FT=1
97 CAIRO = 1
98 FREETYPE = 1
99 !if "$(GLIB)" == "1"
100 HB_UTILS = \
101         $(HB_UTILS)     \
102         $(CFG)\$(PLAT)\hb-view.exe
103
104 HB_UTILS_DEP_LIBS = $(HB_UTILS_DEP_LIBS) $(CAIRO_LIB) $(FREETYPE_LIB)
105 !else
106 !if [echo Warning: GLib support not enabled, hb-view not built]
107 !endif
108 !endif
109 !endif
110
111 # Enable cairo
112 !if "$(CAIRO)" == "1"
113 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1
114 !endif
115
116 # Enable freetype if desired
117 !if "$(FREETYPE)" == "1"
118 !if "$(FREETYPE_DIR)" != ""
119 HB_CFLAGS = $(HB_CFLAGS) /I$(FREETYPE_DIR)
120 !endif
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)
125 !endif
126
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)
133 !endif
134
135 # Always enable UCDN unless explicitly disabled
136 !if "$(NO_UCDN)" != "1"
137 HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
138 HB_CFLAGS =             \
139         $(HB_CFLAGS)            \
140         $(HB_UCDN_CFLAGS)
141
142 HB_SOURCES = $(HB_SOURCES) $(hb_ucdn_SRCS) $(HB_UCDN_sources)
143 !endif
144
145 # Enable GLib if desired
146 !if "$(GLIB)" == "1"
147 HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
148 HB_CFLAGS =     \
149         $(HB_CFLAGS)                                    \
150         /FImsvc_recommended_pragmas.h   \
151         /I$(PREFIX)\include\glib-2.0    \
152         /I$(PREFIX)\lib\glib-2.0\include
153
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)
157
158 HB_UTILS = \
159         $(HB_UTILS)                                     \
160         $(CFG)\$(PLAT)\hb-shape.exe     \
161         $(CFG)\$(PLAT)\hb-ot-shape-closure.exe
162
163 HB_TESTS = \
164         $(HB_TESTS)     \
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
179
180 !else
181
182 # Define some of the macros in GLib's msvc_recommended_pragmas.h
183 # to reduce some unneeded build-time warnings
184 HB_CFLAGS =     \
185         $(HB_CFLAGS)                    \
186         /wd4244                         \
187         /D_CRT_SECURE_NO_WARNINGS       \
188         /D_CRT_NONSTDC_NO_WARNINGS
189
190 !endif
191
192 !if "$(ICU)" == "1"
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
197
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
202 !endif
203
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)
207 !endif
208
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)
214 !endif
215
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)
221 !endif
222
223 HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern"