From 7fb9cddf1a5d6cc2aaa6169ffbdaf2bb35c4fba0 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 25 Jul 2019 16:12:25 +0800 Subject: [PATCH] MSVC Projects: Re-work gtk3-prebuild project Make it into a NMake Makefile project type, which will form the basis for having less of the generated sources being dist'ed, which is the goal of merge request !1001. Another nice side effect of this is that it makes the gtk3-prebuild projects cleaner. --- build/win32/Makefile.am | 2 + build/win32/config-msvc.mak | 34 ++++ build/win32/generate-msvc.mak | 51 +++++ build/win32/vs10/gtk3-gen-srcs.props | 51 +---- build/win32/vs10/gtk3-prebuild.vcxproj | 143 ++------------ build/win32/vs9/gtk3-gen-srcs.vsprops | 49 +---- build/win32/vs9/gtk3-prebuild.vcproj | 260 ++++++------------------- 7 files changed, 185 insertions(+), 405 deletions(-) create mode 100644 build/win32/config-msvc.mak create mode 100644 build/win32/generate-msvc.mak diff --git a/build/win32/Makefile.am b/build/win32/Makefile.am index 032f0f1cfd..12597b1f45 100644 --- a/build/win32/Makefile.am +++ b/build/win32/Makefile.am @@ -36,7 +36,9 @@ SUBDIRS = \ vs16 EXTRA_DIST += \ + config-msvc.mak \ detectenv-msvc.mak \ + generate-msvc.mak \ gtk-introspection-msvc.mak \ introspection-msvc.mak \ replace.py \ diff --git a/build/win32/config-msvc.mak b/build/win32/config-msvc.mak new file mode 100644 index 0000000000..ed9a7aad85 --- /dev/null +++ b/build/win32/config-msvc.mak @@ -0,0 +1,34 @@ +# NMake Makefile portion for enabling features for Windows builds + +!include detectenv-msvc.mak + +# Configurable paths to the various interpreters we need +!ifndef PERL +PERL = perl +!endif + +!ifndef PYTHON +PYTHON=python +!endif + +# Configurable paths to the various scripts and tools that we are using +!ifndef GLIB_MKENUMS +GLIB_MKENUMS = $(PREFIX)\bin\glib-mkenums +!endif + +!ifndef GLIB_GENMARSHAL +GLIB_GENMARSHAL = $(PREFIX)\bin\glib-genmarshal +!endif + +!ifndef GLIB_COMPILE_RESOURCES +GLIB_COMPILE_RESOURCES = $(PREFIX)\bin\glib-compile-resources.exe +!endif + +!ifndef GDBUS_CODEGEN +GDBUS_CODEGEN = $(PREFIX)\bin\gdbus-codegen +!endif + +# Please do not change anything beneath this line unless maintaining the NMake Makefiles +GTK_MAJOR_VERSION = 3 +GTK_MINOR_VERSION = 24 +GTK_MICRO_VERSION = 10 diff --git a/build/win32/generate-msvc.mak b/build/win32/generate-msvc.mak new file mode 100644 index 0000000000..f1b89769f8 --- /dev/null +++ b/build/win32/generate-msvc.mak @@ -0,0 +1,51 @@ +# NMake Makefile portion for code generation and +# intermediate build directory creation +# Items in here should not need to be edited unless +# one is maintaining the NMake build files. + +!include config-msvc.mak + +all: \ + ..\..\config.h \ + ..\..\gdk\gdkconfig.h + +# Copy the pre-defined config.h.win32 +..\..\config.h: ..\..\config.h.win32 + +# Copy the pre-defined gdkconfig.h.[win32|win32_broadway] +!if "$(CFG)" == "release" || "$(CFG)" == "Release" +GDK_OLD_CFG = debug +!else +GDK_OLD_CFG = release +!endif + +!ifdef BROADWAY +GDK_CONFIG = broadway +GDK_DEL_CONFIG = win32 +GDK_CONFIG_TEMPLATE = ..\..\gdk\gdkconfig.h.win32_broadway +!else +GDK_CONFIG = win32 +GDK_DEL_CONFIG = broadway +GDK_CONFIG_TEMPLATE = ..\..\gdk\gdkconfig.h.win32 +!endif + +..\..\gdk-$(CFG)-$(GDK_CONFIG)-build: $(GDK_CONFIG_TEMPLATE) + @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 + @copy $** $@ + +..\..\gdk\gdkconfig.h: ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build + +..\..\config.h \ +..\..\gdk\gdkconfig.h: + @copy $** $@ + +# Remove the generated files +clean: + @-del ..\..\gdk\gdkconfig.h + @if exist ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build del ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build + @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 + @-del ..\..\config.h diff --git a/build/win32/vs10/gtk3-gen-srcs.props b/build/win32/vs10/gtk3-gen-srcs.props index 0865564f77..e57483343d 100644 --- a/build/win32/vs10/gtk3-gen-srcs.props +++ b/build/win32/vs10/gtk3-gen-srcs.props @@ -4,41 +4,11 @@ - copy ..\..\..\config.h.win32 ..\..\..\config.h - -if exist ..\..\..\MSVC_$(Configuration) goto DONE_GDKCONFIG_H - -if exist ..\..\..\gdk\gdkconfig.h del ..\..\..\gdk\gdkconfig.h -if exist ..\..\..\GDK_BROADWAY_BUILD del ..\..\..\GDK_BROADWAY_BUILD -if exist ..\..\..\MSVC_$(Configuration)_Broadway del ..\..\..\MSVC_$(Configuration)_Broadway -if exist $(Configuration)\$(Platform)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll del $(Configuration)\$(Platform)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll -if exist $(Configuration)\$(Platform)\bin\gdk-$(ApiVersion).lib del $(Configuration)\$(Platform)\bin\gdk-$(ApiVersion).lib -if "$(Configuration)" == "Release" del ..\..\..\MSVC_Debug -if "$(Configuration)" == "Debug" del ..\..\..\MSVC_Release -copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h -copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\GDK_WIN32ONLY_BUILD -echo $(Configuration) > ..\..\..\MSVC_$(Configuration) - -:DONE_GDKCONFIG_H - - -if exist ..\..\..\MSVC_$(Configuration)_Broadway goto DONE_GDKCONFIG_H - -if exist ..\..\..\gdk\gdkconfig.h del ..\..\..\gdk\gdkconfig.h -if exist ..\..\..\GDK_WIN32ONLY_BUILD del ..\..\..\GDK_WIN32ONLY_BUILD -if exist ..\..\..\MSVC_Release del ..\..\..\MSVC_Release -if exist ..\..\..\MSVC_Debug del ..\..\..\MSVC_Debug - -if "$(Configuration)" == "Release_Broadway" del ..\..\..\MSVC_Debug_Broadway -if "$(Configuration)" == "Debug_Broadway" del ..\..\..\MSVC_Release_Broadway - -copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\gdk\gdkconfig.h -copy ..\..\..\gdk\gdkconfig.h.win32_broadway ..\..\..\GDK_BROADWAY_BUILD -echo $(Configuration) > ..\..\..\MSVC_$(Configuration)_Broadway - -:DONE_GDKCONFIG_H - - $(GlibEtcInstallRoot)\bin\gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk --generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml + cd .. +set VCInstallDir=$(VCInstallDir) +nmake -f generate-msvc.mak PREFIX=$(GlibEtcInstallRoot) + ..\..\..\config.h;..\..\..\gdk\gdkconfig.h + c:\vs$(VSVer).0\$(Platform)\bin\gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk --generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml cd ..\..\..\gtk & $(PythonDir)\python $(GDbusCodeGenCmd) & cd $(SolutionDir) copy ..\..\..\gtk\gtk-win32.rc.body ..\..\..\gtk\gtk-win32.rc $(PythonDir)\python ..\replace.py --action=replace-var --input=..\..\..\gtk\libgtk3.manifest.in --output=..\..\..\gtk\libgtk3.manifest --var=EXE_MANIFEST_ARCHITECTURE --outstring=* @@ -55,14 +25,11 @@ del ..\..\..\gtk\gtktypefuncs.combined.c ..\..\..\gtk\gtktypefuncs.preproc.c <_PropertySheetDisplayName>gtk3gensrcsprops - - $(GenConfigH) + + $(GenerateRequiredSourcesBase) - - $(GenGdkConfigHWin32) - - - $(GenGdkConfigHBroadway) + + $(GeneratedSources) $(GDbusCodeGenCmd) diff --git a/build/win32/vs10/gtk3-prebuild.vcxproj b/build/win32/vs10/gtk3-prebuild.vcxproj index 05e8131f3f..a854d85c1d 100644 --- a/build/win32/vs10/gtk3-prebuild.vcxproj +++ b/build/win32/vs10/gtk3-prebuild.vcxproj @@ -41,46 +41,46 @@ - Utility + Makefile MultiByte true v100 - Utility + Makefile MultiByte v100 - Utility + Makefile MultiByte true v100 - Utility + Makefile MultiByte v100 - Utility + Makefile MultiByte true v100 - Utility + Makefile MultiByte v100 - Utility + Makefile MultiByte true v100 - Utility + Makefile MultiByte v100 @@ -121,121 +121,20 @@ - $(GlibEtcInstallRoot)\ - - $(GlibEtcInstallRoot)\ - - $(GlibEtcInstallRoot)\ - - $(GlibEtcInstallRoot)\ - - $(GlibEtcInstallRoot)\ - - $(GlibEtcInstallRoot)\ - - $(GlibEtcInstallRoot)\ - - $(GlibEtcInstallRoot)\ - + $(GenerateRequiredSourcesBase) CFG=Debug BROADWAY=1 + $(GenerateRequiredSourcesBase) CFG=Release BROADWAY=1 + $(GenerateRequiredSourcesBase) CFG=$(Configuration) + $(GenerateRequiredSourcesBase) CFG=$(Configuration) + $(GenerateRequiredSourcesBase) CFG=Debug BROADWAY=1 clean all + $(GenerateRequiredSourcesBase) CFG=Release BROADWAY=1 clean all + $(GenerateRequiredSourcesBase) CFG=$(Configuration) clean all + $(GenerateRequiredSourcesBase) CFG=$(Configuration) clean all + $(GenerateRequiredSourcesBase) CFG=Debug BROADWAY=1 clean + $(GenerateRequiredSourcesBase) CFG=Release BROADWAY=1 clean + $(GenerateRequiredSourcesBase) CFG=$(Configuration) clean + $(GenerateRequiredSourcesBase) CFG=$(Configuration) clean + $(GeneratedSources) - - - - - - - - - - - - - - - - - - - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - Copying config.h from config.h.win32... - $(GenConfigH) - ..\..\..\config.h;%(Outputs) - - - Copying gdkconfig from gdkconfig.win32... - $(GenGdkConfigHWin32) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_WIN32ONLY_BUILD;..\..\..\MSVC_$(Configuration);%(Outputs) - Copying gdkconfig from gdkconfig.win32... - $(GenGdkConfigHWin32) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_WIN32ONLY_BUILD;..\..\..\MSVC_$(Configuration);%(Outputs) - Copying gdkconfig from gdkconfig.win32... - $(GenGdkConfigHWin32) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_WIN32ONLY_BUILD;..\..\..\MSVC_$(Configuration);%(Outputs) - Copying gdkconfig from gdkconfig.win32... - $(GenGdkConfigHWin32) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_WIN32ONLY_BUILD;..\..\..\MSVC_$(Configuration);%(Outputs) - - - Copying gdkconfig from gdkconfig.win32_broadway... - $(GenGdkConfigHBroadway) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_BROADWAY_BUILD;..\..\..\MSVC_$(Configuration)_Broadway;%(Outputs) - Copying gdkconfig from gdkconfig.win32_broadway... - $(GenGdkConfigHBroadway) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_BROADWAY_BUILD;..\..\..\MSVC_$(Configuration)_Broadway;%(Outputs) - Copying gdkconfig from gdkconfig.win32_broadway... - $(GenGdkConfigHBroadway) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_BROADWAY_BUILD;..\..\..\MSVC_$(Configuration)_Broadway;%(Outputs) - Copying gdkconfig from gdkconfig.win32_broadway... - $(GenGdkConfigHBroadway) - ..\..\..\gdk\gdkconfig.h;..\..\..\GDK_BROADWAY_BUILD;..\..\..\MSVC_$(Configuration)_Broadway;%(Outputs) - - - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - Copying demos.h from demos.h.win32... - $(CopyDemosH) - ..\..\..\demos\gtk-demo\demos.h;%(Outputs) - - diff --git a/build/win32/vs9/gtk3-gen-srcs.vsprops b/build/win32/vs9/gtk3-gen-srcs.vsprops index b74bf9a71f..acf89b696e 100644 --- a/build/win32/vs9/gtk3-gen-srcs.vsprops +++ b/build/win32/vs9/gtk3-gen-srcs.vsprops @@ -6,53 +6,12 @@ InheritedPropertySheets=".\gtk3-build-defines.vsprops" > - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -