config-msvc.mak 5.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# NMake Makefile portion for enabling features for Windows builds

# You may change these lines to customize the .lib files that will be linked to
# Additional Libraries for building HarfBuzz-ICU
# icudt.lib may be required for static ICU builds
HB_ICU_DEP_LIBS = icuuc.lib

# GLib is required for all utility programs and tests
HB_GLIB_LIBS = glib-2.0.lib

# Needed for building HarfBuzz-GObject
HB_GOBJECT_DEP_LIBS = gobject-2.0.lib $(HB_GLIB_LIBS)

# Freetype is needed for building FreeType support and hb-view
15 16 17
!if "$(CFG)" == "debug"
FREETYPE_LIB = freetyped.lib
!else
18
FREETYPE_LIB = freetype.lib
19
!endif
20 21 22 23 24 25 26

# Cairo is needed for building hb-view
CAIRO_LIB = cairo.lib

# Graphite2 is needed for building SIL Graphite2 support
GRAPHITE2_LIB = graphite2.lib

27 28 29
# Uniscribe is needed for Uniscribe shaping support
UNISCRIBE_LIB = usp10.lib gdi32.lib rpcrt4.lib user32.lib

30 31 32
# Directwrite is needed for DirectWrite shaping support
DIRECTWRITE_LIB = dwrite.lib

33 34 35 36 37 38 39 40
# Please do not change anything beneath this line unless maintaining the NMake Makefiles
# Bare minimum features and sources built into HarfBuzz on Windows
HB_DEFINES =
HB_CFLAGS = /DHAVE_CONFIG_H
HB_UCDN_CFLAGS = /I..\src\hb-ucdn
HB_SOURCES =	\
	$(HB_BASE_sources)		\
	$(HB_FALLBACK_sources)	\
41
	$(HB_OT_sources)
42 43 44 45

HB_HEADERS =	\
	$(HB_BASE_headers)		\
	$(HB_NODIST_headers)	\
46
	$(HB_OT_headers)
47 48

# Minimal set of (system) libraries needed for the HarfBuzz DLL
49
HB_DEP_LIBS =
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131

# We build the HarfBuzz DLL/LIB at least
HB_LIBS = $(CFG)\$(PLAT)\harfbuzz.lib

# Note: All the utility and test programs require GLib support to be present!
HB_UTILS =
HB_UTILS_DEP_LIBS = $(HB_GLIB_LIBS)
HB_TESTS =
HB_TESTS_DEP_LIBS = $(HB_GLIB_LIBS)

# Use libtool-style DLL names, if desired
!if "$(LIBTOOL_DLL_NAME)" == "1"
HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-0
HARFBUZZ_ICU_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-icu-0
HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\libharfbuzz-gobject-0
!else
HARFBUZZ_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-vs$(VSVER)
HARFBUZZ_ICU_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-icu-vs$(VSVER)
HARFBUZZ_GOBJECT_DLL_FILENAME = $(CFG)\$(PLAT)\harfbuzz-gobject-vs$(VSVER)
!endif

# Enable HarfBuzz-ICU, if desired
!if "$(ICU)" == "1"
HB_ICU_CFLAGS =
HB_LIBS =	\
	$(HB_LIBS)	\
	$(CFG)\$(PLAT)\harfbuzz-icu.lib

# We don't want to re-define int8_t Visual Studio 2008, will cause build breakage
# as we define it in hb-common.h, and we ought to use the definitions there.
!if "$(VSVER)" == "9"
HB_ICU_CFLAGS = /DU_HAVE_INT8_T
!endif

!endif

# Enable Introspection (enables HarfBuzz-Gobject as well)
!if "$(INTROSPECTION)" == "1"
GOBJECT = 1
CHECK_PACKAGE = gobject-2.0
EXTRA_TARGETS = $(CFG)\$(PLAT)\HarfBuzz-0.0.gir $(CFG)\$(PLAT)\HarfBuzz-0.0.typelib
!else
EXTRA_TARGETS =
!endif

# Enable HarfBuzz-GObject (enables GLib support as well)
!if "$(GOBJECT)" == "1"
GLIB = 1
HB_LIBS =	\
	$(HB_LIBS)	\
	$(CFG)\$(PLAT)\harfbuzz-gobject.lib

HB_GOBJECT_ENUM_GENERATED_SOURCES = \
	$(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.cc	\
	$(CFG)\$(PLAT)\harfbuzz-gobject\hb-gobject-enums.h

!endif

# Enable cairo-ft (enables cairo and freetype as well)
!if "$(CAIRO_FT)" == "1"
HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO_FT=1
CAIRO = 1
FREETYPE = 1
!if "$(GLIB)" == "1"
HB_UTILS = \
	$(HB_UTILS)	\
	$(CFG)\$(PLAT)\hb-view.exe

HB_UTILS_DEP_LIBS = $(HB_UTILS_DEP_LIBS) $(CAIRO_LIB) $(FREETYPE_LIB)
!else
!if [echo Warning: GLib support not enabled, hb-view not built]
!endif
!endif
!endif

# Enable cairo
!if "$(CAIRO)" == "1"
HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1
!endif

# Enable freetype if desired
!if "$(FREETYPE)" == "1"
132 133 134
!if "$(FREETYPE_DIR)" != ""
HB_CFLAGS = $(HB_CFLAGS) /I$(FREETYPE_DIR)
!endif
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
HB_DEFINES = $(HB_DEFINES) /DHAVE_FREETYPE=1
HB_SOURCES = $(HB_SOURCES) $(HB_FT_sources)
HB_HEADERS = $(HB_HEADERS) $(HB_FT_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(FREETYPE_LIB)
!endif

# Enable graphite2 if desired
!if "$(GRAPHITE2)" == "1"
HB_DEFINES = $(HB_DEFINES) /DHAVE_GRAPHITE2=1
HB_SOURCES = $(HB_SOURCES) $(HB_GRAPHITE2_sources)
HB_HEADERS = $(HB_HEADERS) $(HB_GRAPHITE2_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(GRAPHITE2_LIB)
!endif

# Enable GLib if desired
!if "$(GLIB)" == "1"
HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
HB_CFLAGS =	\
	$(HB_CFLAGS)					\
	/FImsvc_recommended_pragmas.h	\
	/I$(PREFIX)\include\glib-2.0	\
	/I$(PREFIX)\lib\glib-2.0\include

HB_SOURCES = $(HB_SOURCES) $(HB_GLIB_sources)
HB_HEADERS = $(HB_HEADERS) $(HB_GLIB_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_GLIB_LIBS)

HB_UTILS = \
	$(HB_UTILS)					\
	$(CFG)\$(PLAT)\hb-shape.exe	\
	$(CFG)\$(PLAT)\hb-ot-shape-closure.exe

HB_TESTS = \
	$(HB_TESTS)	\
	$(CFG)\$(PLAT)\main.exe						\
	$(CFG)\$(PLAT)\test.exe						\
	$(CFG)\$(PLAT)\test-buffer-serialize.exe	\
	$(CFG)\$(PLAT)\test-size-params.exe			\
	$(CFG)\$(PLAT)\test-would-substitute.exe	\
	$(CFG)\$(PLAT)\test-blob.exe				\
	$(CFG)\$(PLAT)\test-buffer.exe				\
	$(CFG)\$(PLAT)\test-common.exe				\
	$(CFG)\$(PLAT)\test-font.exe				\
	$(CFG)\$(PLAT)\test-object.exe				\
	$(CFG)\$(PLAT)\test-set.exe					\
	$(CFG)\$(PLAT)\test-shape.exe				\
	$(CFG)\$(PLAT)\test-unicode.exe				\
	$(CFG)\$(PLAT)\test-version.exe

!else
# If there is no GLib support, use the built-in UCDN
# and define some of the macros in GLib's msvc_recommended_pragmas.h
# to reduce some unneeded build-time warnings
HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
HB_CFLAGS =	\
	$(HB_CFLAGS)					\
	$(HB_UCDN_CFLAGS)				\
	/wd4244							\
	/D_CRT_SECURE_NO_WARNINGS		\
	/D_CRT_NONSTDC_NO_WARNINGS

HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
!endif

199 200 201 202 203 204 205
!if "$(UNISCRIBE)" == "1"
HB_CFLAGS = $(HB_CFLAGS) /DHAVE_UNISCRIBE
HB_SOURCES = $(HB_SOURCES) $(HB_UNISCRIBE_sources)
HB_HEADERS = $(HB_HEADERS) $(HB_UNISCRIBE_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(UNISCRIBE_LIB)
!endif

206 207 208 209 210 211 212
!if "$(DIRECTWRITE)" == "1"
HB_CFLAGS = $(HB_CFLAGS) /DHAVE_DIRECTWRITE
HB_SOURCES = $(HB_SOURCES) $(HB_DIRECTWRITE_sources)
HB_HEADERS = $(HB_HEADERS) $(HB_DIRECTWRITE_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(DIRECTWRITE_LIB)
!endif

213
HB_LIB_CFLAGS = $(HB_CFLAGS) /DHB_EXTERN="__declspec (dllexport) extern"