[gtk/msvc-project-improvements: 3/4] win32: Support (re-)generating gdkenumtypes.[c|h]




commit c7eeb4c5fc817708e5338dd244fca6138c898f80
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Dec 21 17:30:03 2021 +0800

    win32: Support (re-)generating gdkenumtypes.[c|h]
    
    Add support in the NMake Makefiles used by the Visual Studio builds to generate
    the enumeration sources in gdk/ in its own build directory.

 win32/create-lists-msvc.mak | 17 +++++++++++++++++
 win32/generate-msvc.mak     | 16 ++++++++++++++++
 2 files changed, 33 insertions(+)
---
diff --git a/win32/create-lists-msvc.mak b/win32/create-lists-msvc.mak
index b1bf65d2c4..9f7eeef712 100644
--- a/win32/create-lists-msvc.mak
+++ b/win32/create-lists-msvc.mak
@@ -33,6 +33,23 @@
 
 NULL=
 
+# For GDK enumeration sources
+!include ..\gdk\gdk-pub-headers.mak
+
+!if [call create-lists.bat header gdk_headers.mak GDK_PUBLIC_HEADERS]
+!endif
+
+!if [for %f in ($(gdk_public_h_sources) $(deprecated_h_sources)) do @call create-lists.bat file 
gdk_headers.mak ../gdk/%f]
+!endif
+
+!if [call create-lists.bat footer gdk_headers.mak]
+!endif
+
+!include gdk_headers.mak
+
+!if [del /f /q gdk_headers.mak]
+!endif
+
 # For GDK resources
 
 !if [call create-lists.bat header resources_sources.mak GDK_RESOURCES]
diff --git a/win32/generate-msvc.mak b/win32/generate-msvc.mak
index 5d02daa5d1..4290b10dd1 100644
--- a/win32/generate-msvc.mak
+++ b/win32/generate-msvc.mak
@@ -36,6 +36,8 @@ GDK_GENERATED_SOURCES =       \
        ..\gdk\gdkmarshalers.c  \
        ..\gdk\gdkresources.h   \
        ..\gdk\gdkresources.c   \
+       .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.c        \
+       .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.h
 
 generate-base-sources: \
        ..\config.h     \
@@ -74,6 +76,17 @@ generate-base-sources:       \
        @echo Copying $@...
        @copy $** $@
 
+.\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.c: ..\gdk\gdkenumtypes.c.template 
$(GDK_PUBLIC_HEADERS)
+.\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.h: ..\gdk\gdkenumtypes.h.template 
$(GDK_PUBLIC_HEADERS)
+
+.\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.c       \
+.\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.h:
+       @echo Generating $@...
+       @if not exist $(@D)\ md $(@D)
+       @cd ..\gdk
+       @$(PYTHON) $(GLIB_MKENUMS) --template $(@F).template $(gdk_public_h_sources) $(deprecated_h_sources) 
..\win32\$@
+       @cd ..\win32
+
 ..\gdk\gdkversionmacros.h: ..\gdk\gdkversionmacros.h.in
        @echo Generating $@...
        @$(PYTHON) gen-gdkversionmacros-h.py --version=$(GTK_VERSION)
@@ -218,6 +231,8 @@ clean:
        @-del /f /q ..\gtk\gtkdbusgenerated.h
        @-del /f /q ..\gtk\libgtk3.manifest
        @-del /f /q ..\gtk\gtk-win32.rc
+       @-del /f /q .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.c
+       @-del /f /q .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk\gdkenumtypes.h
        @-del /f /q ..\gdk\gdkresources.c
        @-del /f /q ..\gdk\gdkresources.h
        @-del /f /q ..\gdk\gdk.gresource.xml
@@ -229,4 +244,5 @@ clean:
        @if exist ..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build del 
..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build
        @if exist ..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build del ..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build
        @if exist ..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build del ..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build
+       @-rd .\vs$(VSVER)\$(CFG)\$(PLAT)\obj\gdk-3\gdk
        @-del /f /q ..\config.h


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]