Update ResPack project, write ResPack target for MSBuild and add libresrc project that uses the ResPack target.

The ResPack target is not ideal, it will regenerate the source files even when they are up to date, if only the object files are outdated. This means that in batch builds, the source files will get regenerated for every platform/config built.

Originally committed to SVN as r5175.
This commit is contained in:
Niels Martin Hansen 2011-01-11 20:25:47 +00:00
parent 3974dfd1f2
commit f1121898b9
4 changed files with 188 additions and 22 deletions

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BD00D65F-24DA-4784-8860-3B972EA125FC}</ProjectGuid>
<RootNamespace>libresrc</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<PropertyGroup>
<AegisubUseWxWidgets>true</AegisubUseWxWidgets>
<SrcDir>..\..\..\src\libresrc\</SrcDir>
</PropertyGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\aegisub.props" />
</ImportGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResPack>
<OutputDir>$(SrcDir)</OutputDir>
</ResPack>
</ItemDefinitionGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemGroup>
<ResPack Include="..\..\..\src\libresrc\manifest.respack">
<OutputName>default_config.cpp</OutputName>
<OutputHeader>default_config.h</OutputHeader>
</ResPack>
<ResPack Include="..\..\..\src\bitmaps\manifest.respack">
<OutputName>bitmap.cpp</OutputName>
<OutputHeader>bitmap.h</OutputHeader>
</ResPack>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(SrcDir)libresrc.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(SrcDir)libresrc.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="$(MSBuildThisFileDirectory)..\respack\Aegisub.ResPack.targets" />
</ImportGroup>
</Project>

View file

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\libresrc\bitmap.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\libresrc\default_config.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\libresrc\libresrc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\libresrc\bitmap.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\libresrc\default_config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\libresrc\libresrc.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Copyright (c) 2011 Niels Martin Hansen
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Aegisub Group nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Aegisub Project http://www.aegisub.org/
$Id$
-->
<PropertyGroup>
<ResPackExe Condition="'$(ResPackExe)' == ''">$(MSBuildThisFileDirectory)respack.exe</ResPackExe>
</PropertyGroup>
<Target
Name="ResPackGenerate"
BeforeTargets="ClCompile"
DependsOnTargets="PrepareForBuild"
Condition="'@(ResPack)' != ''"
Inputs="@(ResPack)"
Outputs="%(ResPack.OutputDir)%(ResPack.OutputName);%(ResPack.OutputDir)%(Respack.OutputHeader')"
>
<Exec
Command='$(ResPackExe) "@(ResPack)" "%(ResPack.OutputName)" "%(ResPack.OutputHeader)"'
Outputs="%(ResPack.OutputName);%(ResPack.OutputHeader)"
WorkingDirectory="%(ResPack.OutputDir)"
/>
</Target>
<Target
Name="ResPack"
BeforeTargets="ClCompile"
DependsOnTargets="ResPackGenerate"
Condition="'@(ResPack)' != ''"
Inputs="@(ResPack)"
Outputs="%(ResPack.OutputDir)%(ResPack.OutputName);%(ResPack.OutputDir)%(Respack.OutputHeader')"
>
<ItemGroup>
<ClCompile Include="%(ResPack.OutputDir)%(ResPack.OutputName)" />
</ItemGroup>
</Target>
</Project>

View file

@ -26,42 +26,25 @@
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(MSBuildThisFileDir)..\userconfig\*.props" />
<Import Project="$(MSBuildThisFileDir)..\wx.props" />
<Import Project="$(MSBuildThisFileDir)..\aegisub.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(ProjectDir)</OutDir>
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
<TargetName>respackd</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(ProjectDir)</OutDir>
<IntDir>$(ProjectDir)$(Configuration)\</IntDir>
<TargetName>respack</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>