Imported Upstream version 1.2.7
[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 FREETYPE_LIB = freetype.lib
16
17 # Cairo is needed for building hb-view
18 CAIRO_LIB = cairo.lib
19
20 # Graphite2 is needed for building SIL Graphite2 support
21 GRAPHITE2_LIB = graphite2.lib
22
23 # Directwrite is needed for DirectWrite shaping support
24 DIRECTWRITE_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
28 HB_DEFINES =
29 HB_CFLAGS = /DHAVE_CONFIG_H
30 HB_UCDN_CFLAGS = /I..\src\hb-ucdn
31 HB_SOURCES =    \
32         $(HB_BASE_sources)              \
33         $(HB_FALLBACK_sources)  \
34         $(HB_OT_sources)                \
35         $(HB_UNISCRIBE_sources) \
36
37 HB_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
44 HB_DEP_LIBS = usp10.lib gdi32.lib rpcrt4.lib user32.lib
45
46 # We build the HarfBuzz DLL/LIB at least
47 HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib
48
49 # Note: All the utility and test programs require GLib support to be present!
50 HB_UTILS =
51 HB_UTILS_DEP_LIBS = $(HB_GLIB_LIBS)
52 HB_TESTS =
53 HB_TESTS_DEP_LIBS = $(HB_GLIB_LIBS)
54
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
60 !else
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)
64 !endif
65
66 # Enable HarfBuzz-ICU, if desired
67 !if "$(ICU)" == "1"
68 HB_ICU_CFLAGS =
69 HB_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"
76 HB_ICU_CFLAGS = /DU_HAVE_INT8_T
77 !endif
78
79 !endif
80
81 # Enable Introspection (enables HarfBuzz-Gobject as well)
82 !if "$(INTROSPECTION)" == "1"
83 GOBJECT = 1
84 CHECK_PACKAGE = gobject-2.0
85 EXTRA_TARGETS = $(CFG)\$(PLAT)\HarfBuzz-0.0.gir $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib
86 !else
87 EXTRA_TARGETS =
88 !endif
89
90 # Enable HarfBuzz-GObject (enables GLib support as well)
91 !if "$(GOBJECT)" == "1"
92 GLIB = 1
93 HB_LIBS =       \
94         $(HB_LIBS)      \
95         $(CFG)\$(PLAT)\harfbuzz-gobject.lib
96
97 HB_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"
105 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO_FT=1
106 CAIRO = 1
107 FREETYPE = 1
108 !if "$(GLIB)" == "1"
109 HB_UTILS = \
110         $(HB_UTILS)     \
111         $(CFG)\$(PLAT)\hb-view.exe
112
113 HB_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"
122 HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1
123 !endif
124
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)
131 !endif
132
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)
139 !endif
140
141 # Enable GLib if desired
142 !if "$(GLIB)" == "1"
143 HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
144 HB_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
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)
153
154 HB_UTILS = \
155         $(HB_UTILS)                                     \
156         $(CFG)\$(PLAT)\hb-shape.exe     \
157         $(CFG)\$(PLAT)\hb-ot-shape-closure.exe
158
159 HB_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
180 HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
181 HB_CFLAGS =     \
182         $(HB_CFLAGS)                                    \
183         $(HB_UCDN_CFLAGS)                               \
184         /wd4244                                                 \
185         /D_CRT_SECURE_NO_WARNINGS               \
186         /D_CRT_NONSTDC_NO_WARNINGS
187
188 HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
189 !endif
190
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)
196 !endif
197
198 HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern"