[librsvg/msvc-gen-docs] NMake Makefiles: Support generating documentation
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/msvc-gen-docs] NMake Makefiles: Support generating documentation
- Date: Thu, 28 Apr 2022 03:10:45 +0000 (UTC)
commit da8f8081a05300d6def7288d66590ed8b3657610
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Thu Apr 28 11:07:10 2022 +0800
NMake Makefiles: Support generating documentation
Since the switch to gi-docgen, it is much easier to generate documentation for
Visual Studio builds, so add support for that in the NMake Makefiles.
Generally, it depends on the Python module gi-docgen to be installed (quite
easily via PIP), and requires that one passes in INTROSPECTION=1 along with
generate-docs in the NMake command line.
win32/build-rules-msvc.mak | 1 +
win32/generate-msvc.mak | 11 +++++++++++
win32/install-msvc.mak | 2 ++
win32/introspection-msvc.mak | 6 ++++++
4 files changed, 20 insertions(+)
---
diff --git a/win32/build-rules-msvc.mak b/win32/build-rules-msvc.mak
index a1ec221c1..374e8b2b1 100644
--- a/win32/build-rules-msvc.mak
+++ b/win32/build-rules-msvc.mak
@@ -111,6 +111,7 @@ $(OUTDIR)\Rsvg-2.0.typelib: $(OUTDIR)\Rsvg-2.0.gir
!endif
clean:
+ @-if exist Rsvg-$(RSVG_API_VER)\ rmdir /s/q Rsvg-$(RSVG_API_VER)
@if exist $(OUTDIR)\Rsvg-$(RSVG_API_VER).typelib del /f /q $(OUTDIR)\Rsvg-$(RSVG_API_VER).typelib
@if exist $(OUTDIR)\Rsvg-$(RSVG_API_VER).gir del /f /q $(OUTDIR)\Rsvg-$(RSVG_API_VER).gir
@-del /f /q $(OUTDIR)\*.dll
diff --git a/win32/generate-msvc.mak b/win32/generate-msvc.mak
index 7c47ad435..4a93afb8b 100644
--- a/win32/generate-msvc.mak
+++ b/win32/generate-msvc.mak
@@ -19,6 +19,17 @@ $(OUTDIR)\librsvg\Rsvg_2_0_gir_list: $(librsvg_real_pub_HDRS)
@if exist $@ del $@
@for %%s in ($**) do @echo %%s >> $@
+# Generate documentation (introspection must be built)
+!ifdef INTROSPECTION
+generate-docs: ..\doc\librsvg.toml $(OUTDIR)\Rsvg-$(RSVG_API_VER).gir
+ @echo Generating documentation...
+ @$(GI_DOCGEN) generate -C $** --content-dir=..\doc \
+ --add-include-path=$(G_IR_INCLUDEDIR)
+!else
+generate-docs:
+ @echo Introspection must be enabled to build documentation
+!endif
+
# Generate NMake Makefiles (for git checkouts only)
!ifndef IS_NOT_GIT
diff --git a/win32/install-msvc.mak b/win32/install-msvc.mak
index 0b541bd9e..fb84be820 100644
--- a/win32/install-msvc.mak
+++ b/win32/install-msvc.mak
@@ -25,3 +25,5 @@ install: all
@if not exist librsvg-2.0.pc echo *** librsvg-2.0.pc is not generated! Generate it later using
^$(PYTHON) --version=$(RSVG_PKG_VERSION) --prefix=^$(PREFIX)
@if exist librsvg-2.0.pc if not exist $(PREFIX)\lib\pkgconfig mkdir $(PREFIX)\lib\pkgconfig
@if exist librsvg-2.0.pc move librsvg-2.0.pc $(PREFIX)\lib\pkgconfig
+ @if exist Rsvg-$(RSVG_API_VER)\ if not exist $(PREFIX)\doc\Rsvg-$(RSVG_API_VER)\ mkdir
$(PREFIX)\doc\Rsvg-$(RSVG_API_VER)
+ @copy /b/y Rsvg-$(RSVG_API_VER)\* $(PREFIX)\doc\Rsvg-$(RSVG_API_VER)
diff --git a/win32/introspection-msvc.mak b/win32/introspection-msvc.mak
index e395a2de3..2e7b775af 100644
--- a/win32/introspection-msvc.mak
+++ b/win32/introspection-msvc.mak
@@ -42,11 +42,17 @@ PKG_CONFIG=pkg-config
GIR_SUBDIR = share\gir-1.0
GIR_TYPELIBDIR = lib\girepository-1.0
+
G_IR_SCANNER = $(BINDIR)\g-ir-scanner
G_IR_COMPILER = $(BINDIR)\g-ir-compiler.exe
G_IR_INCLUDEDIR = $(BINDIR)\..\$(GIR_SUBDIR)
G_IR_TYPELIBDIR = $(BINDIR)\..\$(GIR_TYPELIBDIR)
+# Used for generating the documentation using gi-docgen
+!ifndef GI_DOCGEN
+GI_DOCGEN = gi-docgen
+!endif
+
VALID_PKG_CONFIG_PATH = FALSE
MSG_INVALID_PKGCONFIG = You must set or specifiy a valid PKG_CONFIG_PATH
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]