Update Visual Studio builds for UCDN usage

We now use UCDN by default, so make it so in the build files; however
don't hardcode HAVE_UCDN as one may still opt not to use it (but pass
it in as a CFLAG unless one explicitly disables UCDN by using NO_UCDN=1
on the NMake command line).

Note that we are not blocking builds where UCDN is disabled along with
GLib and ICU, as that will trigger a build error anyways which will tell
the user what needs to be done to remedy this.
pull/442/head
Chun-wei Fan 8 years ago committed by Khaled Hosny
parent 60e2586f76
commit f0aa167e44
  1. 6
      win32/README.txt
  2. 28
      win32/config-msvc.mak
  3. 2
      win32/config.h.win32.in
  4. 43
      win32/info-msvc.mak

@ -36,7 +36,7 @@ PREFIX: Optional. Base directory of where the third-party headers, libraries
Explanation of options, set by <option>=1:
------------------------------------------
GLIB: Enable GLib support in HarfBuzz, which also uses the GLib unicode
callback instead of the bundled UCDN unicode callback. This requires the
callback if the bundled UCDN unicode callback is disabled. This requires the
GLib libraries, and is required for building all tool and test programs.
GOBJECT: Enable building the HarfBuzz-GObject DLL, and thus implies GLib
@ -63,7 +63,7 @@ CAIRO_FT: Enable the build of the hb-view tool, which makes use of Cairo, and
GRAPHITE2: Enable the Graphite2 shaper, requires the SIL Graphite2 library.
ICU: Enables the build of ICU Unicode functions. Requires the ICU libraries.
ICU: Enables the build of ICU Unicode functions. Requires the ICU libraries.
UNISCRIBE: Enable Uniscribe platform shaper support.
@ -75,4 +75,4 @@ PYTHON: Full path to the Python interpretor to be used, if it is not in %PATH%.
PERL: Full path to the PERL interpretor to be used, if it is not in %PATH%.
LIBTOOL_DLL_NAME: Enable libtool-style DLL names.
LIBTOOL_DLL_NAME: Enable libtool-style DLL names.

@ -129,6 +129,16 @@ HB_HEADERS = $(HB_HEADERS) $(HB_GRAPHITE2_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(GRAPHITE2_LIB)
!endif
# Always enable UCDN unless explicitly disabled
!if "$(NO_UCDN)" != "1"
HB_DEFINES = $(HB_DEFINES) /DHAVE_UCDN=1
HB_CFLAGS = \
$(HB_CFLAGS) \
$(HB_UCDN_CFLAGS)
HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
!endif
# Enable GLib if desired
!if "$(GLIB)" == "1"
HB_DEFINES = $(HB_DEFINES) /DHAVE_GLIB=1
@ -164,16 +174,12 @@ HB_TESTS = \
$(CFG)\$(PLAT)\test-unicode.exe \
$(CFG)\$(PLAT)\test-version.exe
!elseif "$(ICU)" == "1"
!else
!if "$(ICU)" == "1"
# use ICU for Unicode functions
# 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_ICU=1 /DHAVE_ICU_BUILTIN=1
HB_CFLAGS = \
$(HB_CFLAGS) \
/wd4244 \
/D_CRT_SECURE_NO_WARNINGS \
/D_CRT_NONSTDC_NO_WARNINGS
# We don't want ICU to re-define int8_t in VS 2008, will cause build breakage
# as we define it in hb-common.h, and we ought to use the definitions there.
@ -186,18 +192,14 @@ HB_HEADERS = $(HB_HEADERS) $(HB_ICU_headers)
HB_DEP_LIBS = $(HB_DEP_LIBS) $(HB_ICU_DEP_LIBS)
!endif
!if "$(UCDN)" != "0"
# 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 \
$(HB_CFLAGS) \
/wd4244 \
/D_CRT_SECURE_NO_WARNINGS \
/D_CRT_NONSTDC_NO_WARNINGS
HB_SOURCES = $(HB_SOURCES) $(LIBHB_UCDN_sources) $(HB_UCDN_sources)
!endif
!if "$(UNISCRIBE)" == "1"

@ -112,7 +112,7 @@
#define HAVE_SYS_TYPES_H 1
/* Have UCDN Unicode functions */
#define HAVE_UCDN 1
/* #undef HAVE_UCDN */
/* Have Uniscribe library */
/* #undef HAVE_UNISCRIBE */

@ -4,6 +4,9 @@ INC_FEATURES = Fallback OT
BUILT_TOOLS =
BUILT_LIBRARIES = HarfBuzz
!if "$(NO_UCDN)" != "1"
UNICODE_IMPL = ucdn
!else
!if "$(GLIB)" == "1"
UNICODE_IMPL = GLib
INC_FEATURES = $(INC_FEATURES) GLib
@ -13,8 +16,7 @@ BUILT_TOOLS = hb-view.exe $(BUILT_TOOLS)
!endif
!elseif "$(ICU)" == "1"
UNICODE_IMPL = ICU
!else
UNICODE_IMPL = ucdn
!endif
!endif
!if "$(FREETYPE)" == "1"
@ -79,18 +81,18 @@ help:
@echo.
@echo OPTION: Optional, may be any of the following, use OPTION=1 to enable;
@echo multiple OPTION's may be used. If no OPTION is specified, a default
@echo HarfBuzz DLL is built with OpenType and fallback support
@echo with a bundled Unicode implementation (UCDN).
@echo HarfBuzz DLL is built with OpenType and support with a bundled
@echo Unicode implementation (UCDN).
@echo ======
@echo UNISCRIBE:
@echo Enable Uniscribe support.
@echo.
@echo CAIRO_FT:
@echo Enables Cairo-Freetype support, needed for the build of the hb-view utility.
@echo Implies FreeType2 support and also requires Cairo built with FreeType2
@echo support; GLib2 support must also be enabled.
@echo.
@echo DIRECTWRITE:
@echo Enable DirectWrite support, requires a recent enough Windows SDK.
@echo.
@echo GRAPHITE2:
@echo Enable graphite2 support, requires the SIL Graphite2 library
@echo.
@echo FREETYPE:
@echo Enable FreeType2 support, requires the FreeType2 library
@echo.
@ -98,16 +100,19 @@ help:
@echo Enable GLib2 support, with GLib Unicode support, requires the GNOME GLib2
@echo library. Enables the build of utility programs.
@echo.
@echo ICU:
@echo Enable build with ICU Unicode functions, requires the International
@echo Components for Unicode (ICU) libraries.
@echo.
@echo GOBJECT:
@echo Enable the HarfBuzz-GObject library, also implies GLib2 support,
@echo requires the GNOME GLib2 libraries and tools, notably the glib-mkenums
@echo tool script, which will require a PERL interpreter (use
@echo PERL=^$(PATH_TO_PERL_INTERPRETOR)) if it is not already in your PATH).
@echo.
@echo GRAPHITE2:
@echo Enable graphite2 support, requires the SIL Graphite2 library
@echo.
@echo ICU:
@echo Enable build with ICU Unicode functions, requires the International
@echo Components for Unicode (ICU) libraries.
@echo.
@echo INTROSPECTION:
@echo Enable the build of introspection files, also implies GObject/GLib2 support,
@echo requires the GNOME gobject-introspection libraries and tools. You will need
@ -117,15 +122,17 @@ help:
@echo ^$(PATH_TO_PYTHON_INTERPRETOR) respectively, if python.exe is not already
@echo in your PATH.
@echo.
@echo CAIRO_FT:
@echo Enables Cairo-Freetype support, needed for the build of the hb-view utility.
@echo Implies FreeType2 support and also requires Cairo built with FreeType2
@echo support; GLib2 support must also be enabled.
@echo.
@echo LIBTOOL_DLL_NAME:
@echo Use a libtool-style DLL name to mimic the DLL file naming generated by
@echo MinGW builds.
@echo.
@echo NO_UCDN:
@echo Do not use the bundled Unicode callback, which is the default. GLib or
@echo ICU-based unicode callback is therefore required.
@echo
@echo UNISCRIBE:
@echo Enable Uniscribe support.
@echo.
@echo Note that GLib2 support is required for all utility and test programs.
@echo ======
@echo A 'clean' target is supported to remove all generated files, intermediate

Loading…
Cancel
Save