diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2013-11-27 18:05:32 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2013-11-27 18:05:32 +0800 |
commit | c13c74114305a28ce811f95ef4e97084b8fd2b7c (patch) | |
tree | 895a8af4b44a6df159cda9a3d9c56e821b16ffc3 /build | |
parent | fd134d84570515d6b5fa5694dc7d4855e6262db0 (diff) | |
download | gtk+-c13c74114305a28ce811f95ef4e97084b8fd2b7c.tar.gz |
Visual C++ Projects: Add rules to generate GTK DBus sources
Since commit 7c2a5072 the gtkdbusgenerated.[c|h] are not included in the
dist tarball and thus have to be generated, which broke the Visual C++
builds.
This patch adds property sheets and custom build rules for the Visual C++
projects so that gtkdbusgenerated.[c|h] will be generated upon building the
GTK+ DLL sources.
This also tells people building GTK+ from the projects that they need to
have Python 2/3 installed and the Python interpretor needs to be in their
PATH before building GTK+ from the projects.
Diffstat (limited to 'build')
-rw-r--r-- | build/win32/vs10/Makefile.am | 3 | ||||
-rw-r--r-- | build/win32/vs10/README.txt | 5 | ||||
-rw-r--r-- | build/win32/vs10/gtk-gen-sources.props | 20 | ||||
-rw-r--r-- | build/win32/vs10/gtk-version-paths.props | 4 | ||||
-rw-r--r-- | build/win32/vs10/gtk.vcxproj.filtersin | 3 | ||||
-rw-r--r-- | build/win32/vs10/gtk.vcxprojin | 24 | ||||
-rw-r--r-- | build/win32/vs9/Makefile.am | 3 | ||||
-rw-r--r-- | build/win32/vs9/README.txt | 5 | ||||
-rw-r--r-- | build/win32/vs9/gtk-gen-sources.vsprops | 16 | ||||
-rw-r--r-- | build/win32/vs9/gtk-version-paths.vsprops | 4 | ||||
-rw-r--r-- | build/win32/vs9/gtk.vcprojin | 38 |
11 files changed, 111 insertions, 14 deletions
diff --git a/build/win32/vs10/Makefile.am b/build/win32/vs10/Makefile.am index 44b2883d1b..0a0120ba6f 100644 --- a/build/win32/vs10/Makefile.am +++ b/build/win32/vs10/Makefile.am @@ -37,6 +37,7 @@ EXTRA_DIST += \ gtk-version-paths.props \ gtkprebuild-broadway.props \ gtkprebuild.props \ - gtk-copy-gdk-broadway.props + gtk-copy-gdk-broadway.props \ + gtk-gen-sources.props -include $(top_srcdir)/git.mk diff --git a/build/win32/vs10/README.txt b/build/win32/vs10/README.txt index 64c62ddd98..e00b0833a4 100644 --- a/build/win32/vs10/README.txt +++ b/build/win32/vs10/README.txt @@ -20,6 +20,11 @@ ATK and GLib. External dependencies are at least Cairo gettext-runtime, fontconfig*, freetype*, expat*. See the
build/win32/vs10/README.txt file in glib for details where to unpack them.
+You will also need a Python 2.x/3.x interpretor installed on your system,
+which can be obtained from the official installers available from
+http://www.python.org. Please note that the Python interpretor (python.exe)
+needs to be in your path before attempting the build of GTK+.
+
It is recommended that one builds the dependencies with VS10 as far as
possible, especially those from and using the GTK+ stack (i.e. GLib,
Cairo, ATK, Pango, GDK-Pixbuf), so that crashes caused by mixing calls
diff --git a/build/win32/vs10/gtk-gen-sources.props b/build/win32/vs10/gtk-gen-sources.props new file mode 100644 index 0000000000..a2cdd1eb62 --- /dev/null +++ b/build/win32/vs10/gtk-gen-sources.props @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ImportGroup Label="PropertySheets">
+ <Import Project="gtk-build-defines.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros">
+ <GenerateGtkDbusBuiltSources>
+cd ..\..\..\gtk
+
+python $(GlibEtcInstallRoot)\bin\gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk --generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml
+
+cd $(SolutionDir)
+ </GenerateGtkDbusBuiltSources>
+ </PropertyGroup>
+ <ItemGroup>
+ <BuildMacro Include="GenerateGtkDbusBuiltSources">
+ <Value>$(GenerateGtkDbusBuiltSources)</Value>
+ </BuildMacro>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/build/win32/vs10/gtk-version-paths.props b/build/win32/vs10/gtk-version-paths.props index fe2829f05e..62c244a285 100644 --- a/build/win32/vs10/gtk-version-paths.props +++ b/build/win32/vs10/gtk-version-paths.props @@ -2,9 +2,9 @@ <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
<VSVer>10</VSVer>
- <GlibEtcInstallRoot>..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot>
+ <GlibEtcInstallRoot>$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot>
<GlibEtcInstallRootFromBuildWin32>..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRootFromBuildWin32>
- <CopyDir>$(GlibEtcInstallRoot)</CopyDir>
+ <CopyDir>..\..\..\..\vs$(VSVer)\$(Platform)</CopyDir>
<ApiVersion>3.0</ApiVersion>
<GtkLibtoolCompatibleDllPrefix>lib</GtkLibtoolCompatibleDllPrefix>
<GtkLibtoolCompatibleDllSuffix>-$(ApiVersion)-0</GtkLibtoolCompatibleDllSuffix>
diff --git a/build/win32/vs10/gtk.vcxproj.filtersin b/build/win32/vs10/gtk.vcxproj.filtersin index b5b1c9879e..f6be8055fc 100644 --- a/build/win32/vs10/gtk.vcxproj.filtersin +++ b/build/win32/vs10/gtk.vcxproj.filtersin @@ -18,6 +18,9 @@ <ResourceCompile Include="..\..\..\gtk\gtk-win32.rc"><Filter>Resource Files</Filter></ResourceCompile> </ItemGroup> <ItemGroup> + <CustomBuild Include="..\..\..\gtk\gtkdbusinterfaces.xml"><Filter>Resource Files</Filter></CustomBuild> + </ItemGroup> + <ItemGroup> #include "libgtk.vs10.sourcefiles.filters" <ClCompile Include="..\..\..\modules\input\gtkimcontextime.c"><Filter>Source Files</Filter></ClCompile> <ClCompile Include="..\..\..\modules\input\gtkimcontextmultipress.c"><Filter>Source Files</Filter></ClCompile> diff --git a/build/win32/vs10/gtk.vcxprojin b/build/win32/vs10/gtk.vcxprojin index 08057d9174..80a94b3c53 100644 --- a/build/win32/vs10/gtk.vcxprojin +++ b/build/win32/vs10/gtk.vcxprojin @@ -51,19 +51,19 @@ </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="gtk-build-defines.props" /> + <Import Project="gtk-gen-sources.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="gtk-build-defines.props" /> + <Import Project="gtk-gen-sources.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="gtk-build-defines.props" /> + <Import Project="gtk-gen-sources.props" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="gtk-build-defines.props" /> + <Import Project="gtk-gen-sources.props" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup> @@ -159,6 +159,22 @@ </Link> </ItemDefinitionGroup> <ItemGroup> + <CustomBuild Include="..\..\..\gtk\gtkdbusinterfaces.xml"> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating GTK+ DBus Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenerateGtkDbusBuiltSources)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating GTK+ DBus Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenerateGtkDbusBuiltSources)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating GTK+ DBus Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenerateGtkDbusBuiltSources)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating GTK+ DBus Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateGtkDbusBuiltSources)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h%(Outputs)</Outputs> + </CustomBuild> + </ItemGroup> + <ItemGroup> <ResourceCompile Include="..\..\..\gtk\gtk-win32.rc" /> </ItemGroup> <ItemGroup> diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am index f56ec64236..116847a333 100644 --- a/build/win32/vs9/Makefile.am +++ b/build/win32/vs9/Makefile.am @@ -25,6 +25,7 @@ EXTRA_DIST += \ gtk-version-paths.vsprops \ gtkprebuild.vsprops \ gtkprebuild-broadway.vsprops \ - gtk-copy-gdk-broadway.vsprops + gtk-copy-gdk-broadway.vsprops \ + gtk-gen-sources.vsprops -include $(top_srcdir)/git.mk diff --git a/build/win32/vs9/README.txt b/build/win32/vs9/README.txt index 7f0c6ba355..0cf37f4bbc 100644 --- a/build/win32/vs9/README.txt +++ b/build/win32/vs9/README.txt @@ -19,6 +19,11 @@ ATK and GLib. External dependencies are at least Cairo gettext-runtime, fontconfig*, freetype*, expat*. See the
build/win32/vs9/README.txt file in glib for details where to unpack them.
+You will also need a Python 2.x/3.x interpretor installed on your system,
+which can be obtained from the official installers available from
+http://www.python.org. Please note that the Python interpretor (python.exe)
+needs to be in your path before attempting the build of GTK+.
+
It is recommended that one builds the dependencies with VS9 as far as
possible, especially those from and using the GTK+ stack (i.e. GLib,
Cairo, ATK, Pango, GDK-Pixbuf), so that crashes caused by mixing calls
diff --git a/build/win32/vs9/gtk-gen-sources.vsprops b/build/win32/vs9/gtk-gen-sources.vsprops new file mode 100644 index 0000000000..c6f87c5d3f --- /dev/null +++ b/build/win32/vs9/gtk-gen-sources.vsprops @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="gtkgensourcesprops"
+ InheritedPropertySheets=".\gtk-build-defines.vsprops"
+ >
+ <UserMacro
+ Name="GenerateGtkDbusBuiltSources"
+ Value="
+cd ..\..\..\gtk

+python $(GlibEtcInstallRoot)\bin\gdbus-codegen --interface-prefix org.Gtk. --c-namespace _Gtk --generate-c-code gtkdbusgenerated ./gtkdbusinterfaces.xml

+cd $(SolutionDir)

+ "
+ />
+</VisualStudioPropertySheet>
\ No newline at end of file diff --git a/build/win32/vs9/gtk-version-paths.vsprops b/build/win32/vs9/gtk-version-paths.vsprops index 7a97b1895a..5fbda28efd 100644 --- a/build/win32/vs9/gtk-version-paths.vsprops +++ b/build/win32/vs9/gtk-version-paths.vsprops @@ -10,7 +10,7 @@ />
<UserMacro
Name="GlibEtcInstallRoot"
- Value="..\..\..\..\vs$(VSVer)\$(PlatformName)"
+ Value="$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(PlatformName)"
/>
<UserMacro
Name="GlibEtcInstallRootFromBuildWin32"
@@ -18,7 +18,7 @@ />
<UserMacro
Name="CopyDir"
- Value="$(GlibEtcInstallRoot)"
+ Value="..\..\..\..\vs$(VSVer)\$(PlatformName)"
/>
<UserMacro
Name="ApiVersion"
diff --git a/build/win32/vs9/gtk.vcprojin b/build/win32/vs9/gtk.vcprojin index 5ff0484a7b..ebd6ab63d3 100644 --- a/build/win32/vs9/gtk.vcprojin +++ b/build/win32/vs9/gtk.vcprojin @@ -21,7 +21,7 @@ <Configurations>
<Configuration
Name="Debug|Win32"
- InheritedPropertySheets=".\gtk-build-defines.vsprops"
+ InheritedPropertySheets=".\gtk-gen-sources.vsprops"
ConfigurationType="2"
CharacterSet="2"
>
@@ -53,7 +53,7 @@ </Configuration>
<Configuration
Name="Release|Win32"
- InheritedPropertySheets=".\gtk-build-defines.vsprops"
+ InheritedPropertySheets=".\gtk-gen-sources.vsprops"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
@@ -85,7 +85,7 @@ </Configuration>
<Configuration
Name="Debug|x64"
- InheritedPropertySheets=".\gtk-build-defines.vsprops"
+ InheritedPropertySheets=".\gtk-gen-sources.vsprops"
ConfigurationType="2"
CharacterSet="2"
>
@@ -117,7 +117,7 @@ </Configuration>
<Configuration
Name="Release|x64"
- InheritedPropertySheets=".\gtk-build-defines.vsprops"
+ InheritedPropertySheets=".\gtk-gen-sources.vsprops"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="1"
@@ -162,6 +162,36 @@ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
+ <File RelativePath="..\..\..\gtk\gtkdbusinterfaces.xml">
+ <FileConfiguration Name="Debug|Win32">
+ <Tool Name="VCCustomBuildTool"
+ Description="Generating GTK+ DBus Sources..."
+ CommandLine="$(GenerateGtkDbusBuiltSources)"
+ Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|Win32">
+ <Tool Name="VCCustomBuildTool"
+ Description="Generating GTK+ DBus Sources..."
+ CommandLine="$(GenerateGtkDbusBuiltSources)"
+ Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Debug|x64">
+ <Tool Name="VCCustomBuildTool"
+ Description="Generating GTK+ DBus Sources..."
+ CommandLine="$(GenerateGtkDbusBuiltSources)"
+ Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+ />
+ </FileConfiguration>
+ <FileConfiguration Name="Release|x64">
+ <Tool Name="VCCustomBuildTool"
+ Description="Generating GTK+ DBus Sources..."
+ CommandLine="$(GenerateGtkDbusBuiltSources)"
+ Outputs="..\..\..\gtk\gtkdbusgenerated.c;..\..\..\gtk\gtkdbusgenerated.h"
+ />
+ </FileConfiguration>
+ </File>
<File RelativePath="..\..\..\gtk\gtk-win32.rc" />
</Filter>
<Filter
|