diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2013-08-30 14:47:39 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2013-08-30 14:47:39 +0800 |
commit | e0f41974947415c6dace100e2bc782e63f37e9d3 (patch) | |
tree | b207f18ff6d43bc329ec68fbc4e06e8c855a03f8 /build | |
parent | 6f49edfc3ffd18027aa56c34f0faf35da38b30d4 (diff) | |
download | atk-e0f41974947415c6dace100e2bc782e63f37e9d3.tar.gz |
Visual C++ Builds: Use Custom Build Rules
Use custom build rules in the Visual C++ projects because this enables
that the generated files get automatically regenerated when the associated
source files change and that the generated files can be automatically
removed when "clean" is requested.
Also drop some unneeded items from the property sheets.
Diffstat (limited to 'build')
-rw-r--r-- | build/win32/vs10/atk.props | 46 | ||||
-rw-r--r-- | build/win32/vs10/atk.vcxproj.filtersin | 4 | ||||
-rw-r--r-- | build/win32/vs10/atk.vcxprojin | 50 | ||||
-rw-r--r-- | build/win32/vs9/atk.vcprojin | 92 | ||||
-rw-r--r-- | build/win32/vs9/atk.vsprops | 36 |
5 files changed, 163 insertions, 65 deletions
diff --git a/build/win32/vs10/atk.props b/build/win32/vs10/atk.props index b4a4c3a..09f42bb 100644 --- a/build/win32/vs10/atk.props +++ b/build/win32/vs10/atk.props @@ -4,9 +4,9 @@ <ApiVersion>1.0</ApiVersion> <AtkDummyPrefix>\"/dummy\"</AtkDummyPrefix> <VSVer>10</VSVer> - <GlibEtcInstallRoot>..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot> - <GlibEtcInstallRootFromBuildWin32>..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRootFromBuildWin32> + <GlibEtcInstallRoot>$(SolutionDir)\..\..\..\..\vs$(VSVer)\$(Platform)</GlibEtcInstallRoot> <CopyDir>$(GLibEtcInstallRoot)</CopyDir> + <DefDir>$(SolutionDir)$(Configuration)\$(PlatformName)\obj\$(ProjectName)\</DefDir> <AtkDoInstall> mkdir $(CopyDir)\bin @@ -89,13 +89,30 @@ copy $(SolutionDir)$(Configuration)\$(Platform)\bin\*-$(ApiVersion).lib $(CopyDi set VSVER=$(VSVer) set CONF=$(Configuration) set PLAT=$(Platform) -set BASEDIR=$(GlibEtcInstallRootFromBuildWin32) +set BASEDIR=$(GlibEtcInstallRoot) cd .. call gengir.bat cd vs$(VSVer) </DoGenGir> - <GenerateAtkDef>echo EXPORTS >"..\..\..\atk\atk.def" && cl /EP ..\..\..\atk\atk.symbols >>"..\..\..\atk\atk.def"</GenerateAtkDef> + <GenMarshalSrc> +if exist ..\..\..\atk\atkmarshal.h goto DONE_GEN_MARS_H +cd ..\..\..\atk +$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h +cd $(SolutionDir) + +:DONE_GEN_MARS_H +if exist ..\..\..\atk\atkmarshal.c goto DONE_GEN_MARS_C +cd ..\..\..\atk +$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c +cd $(SolutionDir) + +:DONE_GEN_MARS_C + </GenMarshalSrc> + <GenerateAtkDef> +echo EXPORTS > $(DefDir)\atk.def +cl /EP ..\..\..\atk\atk.symbols >> $(DefDir)\atk.def + </GenerateAtkDef> <AtkDefines>ATK_COMPILATION;DLL_EXPORT;ATK_LOCALEDIR="$(AtkDummyPrefix)/share/locale"</AtkDefines> <AtkLibtoolCompatibleDllPrefix>lib</AtkLibtoolCompatibleDllPrefix> <AtkLibtoolCompatibleDllSuffix>-1.0-0</AtkLibtoolCompatibleDllSuffix> @@ -126,20 +143,7 @@ if exist ..\..\..\config.h goto DONE_CONFIG_H copy ..\..\..\config.h.win32 ..\..\..\config.h :DONE_CONFIG_H - -if exist ..\..\..\atk\atkmarshal.h goto GEN_MARS_C - -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal ..\..\..\atk\atkmarshal.list --header >..\..\..\atk\atkmarshal.h - -:GEN_MARS_C - -if exist ..\..\..\atk\atkmarshal.c goto END - -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal ..\..\..\atk\atkmarshal.list --body >..\..\..\atk\atkmarshal.c - -:END - -</Command> + </Command> </PreBuildEvent> </ItemDefinitionGroup> <ItemGroup> @@ -155,9 +159,15 @@ $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal ..\..\..\atk\atkm <BuildMacro Include="CopyDir"> <Value>$(CopyDir)</Value> </BuildMacro> + <BuildMacro Include="DefDir"> + <Value>$(DefDir)</Value> + </BuildMacro> <BuildMacro Include="AtkDoInstall"> <Value>$(AtkDoInstall)</Value> </BuildMacro> + <BuildMacro Include="GenMarshalSrc"> + <Value>$(GenMarshalSrc)</Value> + </BuildMacro> <BuildMacro Include="GenerateAtkDef"> <Value>$(GenerateAtkDef)</Value> </BuildMacro> diff --git a/build/win32/vs10/atk.vcxproj.filtersin b/build/win32/vs10/atk.vcxproj.filtersin index cef25b9..07395b7 100644 --- a/build/win32/vs10/atk.vcxproj.filtersin +++ b/build/win32/vs10/atk.vcxproj.filtersin @@ -18,6 +18,10 @@ #include "libatk.vs10.sourcefiles.filters" </ItemGroup> <ItemGroup> + <CustomBuild Include="..\..\..\atk\atkmarshal.list"><Filter>Resource Files</Filter></CustomBuild> + <CustomBuild Include="..\..\..\atk\atk.symbols"><Filter>Resource Files</Filter></CustomBuild> + </ItemGroup> + <ItemGroup> <ResourceCompile Include="..\..\..\atk\atk.rc"> <Filter>Resource Files</Filter> </ResourceCompile> diff --git a/build/win32/vs10/atk.vcxprojin b/build/win32/vs10/atk.vcxprojin index c156087..a52baf7 100644 --- a/build/win32/vs10/atk.vcxprojin +++ b/build/win32/vs10/atk.vcxprojin @@ -83,13 +83,10 @@ <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>EditAndContinue</DebugInformationFormat> </ClCompile> - <PreLinkEvent> - <Command>$(GenerateAtkDef)</Command> - </PreLinkEvent> <Link> <OutputFile>$(OutDir)$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll</OutputFile> <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> - <ModuleDefinitionFile>..\..\..\atk\atk.def</ModuleDefinitionFile> + <ModuleDefinitionFile>$(IntDir)\atk.def</ModuleDefinitionFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <ImportLibrary>$(OutDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> @@ -108,13 +105,10 @@ <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> - <PreLinkEvent> - <Command>$(GenerateAtkDef)</Command> - </PreLinkEvent> <Link> <OutputFile>$(OutDir)$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll</OutputFile> <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> - <ModuleDefinitionFile>..\..\..\atk\atk.def</ModuleDefinitionFile> + <ModuleDefinitionFile>$(IntDir)\atk.def</ModuleDefinitionFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <OptimizeReferences>true</OptimizeReferences> @@ -135,13 +129,10 @@ <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> - <PreLinkEvent> - <Command>$(GenerateAtkDef)</Command> - </PreLinkEvent> <Link> <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll</OutputFile> - <ModuleDefinitionFile>..\..\..\atk\atk.def</ModuleDefinitionFile> + <ModuleDefinitionFile>$(IntDir)\atk.def</ModuleDefinitionFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary> @@ -157,13 +148,10 @@ <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> </ClCompile> - <PreLinkEvent> - <Command>$(GenerateAtkDef)</Command> - </PreLinkEvent> <Link> <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll</OutputFile> - <ModuleDefinitionFile>..\..\..\atk\atk.def</ModuleDefinitionFile> + <ModuleDefinitionFile>$(IntDir)\atk.def</ModuleDefinitionFile> <GenerateDebugInformation>true</GenerateDebugInformation> <SubSystem>Windows</SubSystem> <OptimizeReferences>true</OptimizeReferences> @@ -176,6 +164,36 @@ #include "libatk.vs10.sourcefiles" </ItemGroup> <ItemGroup> + <CustomBuild Include="..\..\..\atk\atkmarshal.list"> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating Marshalling Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenMarshalSrc)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c;%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating Marshalling Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenMarshalSrc)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c;%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating Marshalling Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenMarshalSrc)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c;%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating Marshalling Sources...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenMarshalSrc)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c;%(Outputs)</Outputs> + </CustomBuild> + <CustomBuild Include="..\..\..\atk\atk.symbols"> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating atk.def...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenerateAtkDef)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)atk.def;%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating atk.def...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenerateAtkDef)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)atk.def;%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating atk.def...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenerateAtkDef)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)atk.def;%(Outputs)</Outputs> + <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating atk.def...</Message> + <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateAtkDef)</Command> + <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)atk.def;%(Outputs)</Outputs> + </CustomBuild> + </ItemGroup> + <ItemGroup> <ResourceCompile Include="..\..\..\atk\atk.rc" /> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> diff --git a/build/win32/vs9/atk.vcprojin b/build/win32/vs9/atk.vcprojin index 1cd6313..8a9fbc5 100644 --- a/build/win32/vs9/atk.vcprojin +++ b/build/win32/vs9/atk.vcprojin @@ -40,15 +40,11 @@ DebugInformationFormat="4" /> <Tool - Name="VCPreLinkEventTool" - CommandLine="$(GenerateAtkDef)" - /> - <Tool Name="VCLinkerTool" OutputFile="$(OutDir)\$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll" LinkIncremental="2" IgnoreDefaultLibraryNames="" - ModuleDefinitionFile="..\..\..\atk\atk.def" + ModuleDefinitionFile="$(IntDir)\atk.def" GenerateDebugInformation="true" SubSystem="2" ImportLibrary="$(OutDir)\$(ProjectName)-$(ApiVersion).lib" @@ -77,15 +73,11 @@ DebugInformationFormat="3" /> <Tool - Name="VCPreLinkEventTool" - CommandLine="$(GenerateAtkDef)" - /> - <Tool Name="VCLinkerTool" OutputFile="$(OutDir)\$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll" LinkIncremental="1" IgnoreDefaultLibraryNames="" - ModuleDefinitionFile="..\..\..\atk\atk.def" + ModuleDefinitionFile="$(IntDir)\atk.def" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" @@ -115,15 +107,11 @@ DebugInformationFormat="3" /> <Tool - Name="VCPreLinkEventTool" - CommandLine="$(GenerateAtkDef)" - /> - <Tool Name="VCLinkerTool" AdditionalDependencies="" OutputFile="$(OutDir)\$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll" LinkIncremental="2" - ModuleDefinitionFile="..\..\..\atk\atk.def" + ModuleDefinitionFile="$(IntDir)\atk.def" GenerateDebugInformation="true" SubSystem="2" ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib" @@ -148,15 +136,11 @@ DebugInformationFormat="3" /> <Tool - Name="VCPreLinkEventTool" - CommandLine="$(GenerateAtkDef)" - /> - <Tool Name="VCLinkerTool" AdditionalDependencies="" OutputFile="$(OutDir)\$(AtkDllPrefix)$(ProjectName)$(AtkDllSuffix).dll" LinkIncremental="2" - ModuleDefinitionFile="..\..\..\atk\atk.def" + ModuleDefinitionFile="$(IntDir)\atk.def" GenerateDebugInformation="true" SubSystem="2" OptimizeReferences="2" @@ -187,6 +171,74 @@ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" > + <File RelativePath="..\..\..\atk\atkmarshal.list"> + <FileConfiguration Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="Generating Marshalling Sources..." + CommandLine="$(GenMarshalSrc)" + Outputs="..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c" + /> + </FileConfiguration> + <FileConfiguration Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="Generating Marshalling Sources..." + CommandLine="$(GenMarshalSrc)" + Outputs="..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c" + /> + </FileConfiguration> + <FileConfiguration Name="Debug|x64"> + <Tool + Name="VCCustomBuildTool" + Description="Generating Marshalling Sources..." + CommandLine="$(GenMarshalSrc)" + Outputs="..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c" + /> + </FileConfiguration> + <FileConfiguration Name="Release|x64"> + <Tool + Name="VCCustomBuildTool" + Description="Generating Marshalling Sources..." + CommandLine="$(GenMarshalSrc)" + Outputs="..\..\..\atk\atkmarshal.h;..\..\..\atk\atkmarshal.c" + /> + </FileConfiguration> + </File> + <File RelativePath="..\..\..\atk\atk.symbols"> + <FileConfiguration Name="Debug|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="Generating atk.def..." + CommandLine="$(GenerateAtkDef)" + Outputs="$(IntDir)\atk.def" + /> + </FileConfiguration> + <FileConfiguration Name="Release|Win32"> + <Tool + Name="VCCustomBuildTool" + Description="Generating atk.def..." + CommandLine="$(GenerateAtkDef)" + Outputs="$(IntDir)\atk.def" + /> + </FileConfiguration> + <FileConfiguration Name="Debug|x64"> + <Tool + Name="VCCustomBuildTool" + Description="Generating atk.def..." + CommandLine="$(GenerateAtkDef)" + Outputs="$(IntDir)\atk.def" + /> + </FileConfiguration> + <FileConfiguration Name="Release|x64"> + <Tool + Name="VCCustomBuildTool" + Description="Generating atk.def..." + CommandLine="$(GenerateAtkDef)" + Outputs="$(IntDir)\atk.def" + /> + </FileConfiguration> + </File> <File RelativePath="..\..\..\atk\atk.rc" /> </Filter> </Files> diff --git a/build/win32/vs9/atk.vsprops b/build/win32/vs9/atk.vsprops index 9cf21f4..61273f9 100644 --- a/build/win32/vs9/atk.vsprops +++ b/build/win32/vs9/atk.vsprops @@ -23,12 +23,6 @@ if exist ..\..\..\config.h goto DONE_CONFIG_H
 copy ..\..\..\config.h.win32 ..\..\..\config.h
 :DONE_CONFIG_H
 -if exist ..\..\..\atk\atkmarshal.h goto GEN_MARS_C
 -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal ..\..\..\atk\atkmarshal.list --header >..\..\..\atk\atkmarshal.h
 -:GEN_MARS_C
 -if exist ..\..\..\atk\atkmarshal.c goto END
 -$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal ..\..\..\atk\atkmarshal.list --body >..\..\..\atk\atkmarshal.c
 -:END
 " /> <UserMacro @@ -37,11 +31,11 @@ $(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal ..\..\..\atk\atkm /> <UserMacro Name="GLibEtcInstallRoot" - Value="..\..\..\..\vs$(VSVER)\$(PlatformName)" + Value="$(SolutionDir)\..\..\..\..\vs$(VSVER)\$(PlatformName)" /> <UserMacro - Name="GlibEtcInstallRootFromBuildWin32" - Value="..\..\..\vs$(VSVer)\$(PlatformName)" + Name="DefDir" + Value="$(SolutionDir)$(ConfigurationName)\$(PlatformName)\obj\$(ProjectName)" /> <UserMacro Name="ApiVersion" @@ -97,12 +91,29 @@ copy $(SolutionDir)$(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib " /> <UserMacro + Name="GenMarshalSrc" + Value=" +if exist ..\..\..\atk\atkmarshal.h goto DONE_GEN_MARS_H
 +cd ..\..\..\atk
 +$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --header > atkmarshal.h
 +cd $(SolutionDir)
 + +:DONE_GEN_MARS_H
 +if exist ..\..\..\atk\atkmarshal.c goto DONE_GEN_MARS_C
 +cd ..\..\..\atk
 +$(GLibEtcInstallRoot)\bin\glib-genmarshal --prefix=atk_marshal atkmarshal.list --body > atkmarshal.c
 +cd $(SolutionDir)
 + +:DONE_GEN_MARS_C
 + " + /> + <UserMacro Name="DoGenGir" Value=" set VSVER=$(VSVer)
 set CONF=$(ConfigurationName)
 set PLAT=$(PlatformName)
 -set BASEDIR=$(GlibEtcInstallRootFromBuildWin32)
 +set BASEDIR=$(GLibEtcInstallRoot)
 cd ..
 call gengir.bat
 @@ -111,7 +122,10 @@ cd vs$(VSVer)
 /> <UserMacro Name="GenerateAtkDef" - Value="echo EXPORTS >"..\..\..\atk\atk.def" && cl /EP ..\..\..\atk\atk.symbols >>"..\..\..\atk\atk.def"" + Value=" +echo EXPORTS > $(DefDir)\atk.def
 +cl /EP ..\..\..\atk\atk.symbols >> $(DefDir)\atk.def + " /> <UserMacro Name="AtkDefines" |