harfbuzz/win32/hb-introspection-msvc.mak
Chun-wei Fan d7b6636e5e build: Support Visual Studio builds using NMake
This adds a set of NMake Makefiles that can be used to build HarfBuzz, from
the standard basic build building the minimal HarfBuzz DLL (consisting
of OpenType, fallback and Uniscribe support only), to a full fledged build
consisting of GLib and FreeType support, as well as building the utilities,
the test programs in src/ and test/api, and HarfBuzz-ICU and
HarfBuzz-GObject, and up to building the introspection files.  This means a
flexible build mechanism is supported here, so anything that is supported
for a Windows build (code-wise), should all be supported by this build
system.

As in an earlier commit, the source listings are shared with the autotools
builds with the various Makefile.sources in src/, src/hb-ucdn and util/, and
this set of NMake Makefiles will transform these lists into the form they
want.

In the current form, all the test programs in test/api pass, and this has
been checked successfully with 'make -j8 distcheck'.
2016-02-03 18:14:30 +08:00

43 lines
1.3 KiB
Makefile

!if "$(BUILD_INTROSPECTION)" == "TRUE"
# Create the file list for introspection (to avoid the dreaded command-line-too-long problem on Windows)
$(CFG)\$(PLAT)\hb_list: $(HB_ACTUAL_HEADERS) $(HB_ACTUAL_SOURCES) $(HB_GOBJECT_ENUM_GENERATED_SOURCES) $(HB_GOBJECT_ACTUAL_SOURCES)
@for %f in ($(HB_ACTUAL_HEADERS) $(HB_ACTUAL_SOURCES) $(HB_GOBJECT_ENUM_GENERATED_SOURCES) $(HB_GOBJECT_ACTUAL_SOURCES)) do @echo %f >> $@
$(CFG)\$(PLAT)\HarfBuzz-0.0.gir: $(CFG)\$(PLAT)\harfbuzz-gobject.lib $(CFG)\$(PLAT)\hb_list
@set LIB=$(CFG)\$(PLAT);$(PREFIX)\lib;$(LIB)
@set PATH=$(CFG)\$(PLAT);$(PREFIX)\bin;$(PATH)
@-echo Generating $@...
$(PYTHON) $(G_IR_SCANNER) \
--verbose -no-libtool \
-I..\src -n hb --identifier-prefix=hb_ --warn-all \
--namespace=HarfBuzz \
--nsversion=0.0 \
--include=GObject-2.0 \
--library=harfbuzz-gobject \
--library=harfbuzz \
--add-include-path=$(G_IR_INCLUDEDIR) \
--pkg-export=harfbuzz \
--cflags-begin \
$(CFLAGS) $(HB_DEFINES) $(HB_CFLAGS) \
-DHB_H \
-DHB_H_IN \
-DHB_OT_H \
-DHB_OT_H_IN \
-DHB_GOBJECT_H \
-DHB_GOBJECT_H_IN \
--cflags-end \
--filelist=$(CFG)\$(PLAT)\hb_list \
-o $@
$(CFG)\$(PLAT)\HarfBuzz-0.0.typelib: $(CFG)\$(PLAT)\HarfBuzz-0.0.gir
@copy $*.gir $(@B).gir
$(PREFIX)\bin\g-ir-compiler \
--includedir=$(CFG)\$(PLAT) --debug --verbose \
$(@B).gir \
-o $@
@del $(@B).gir
!else
!error $(ERROR_MSG)
!endif