Skip to content

Commit 446a768

Browse files
committedJun 3, 2015
Switch to a more maintained zlib fork and add a MSBuild project for it.
Judging from madler/zlib#87 (comment), zlib itself is not really maintained anymore at this point. The latest Visual Studio projects have a number of issues, and therefore it's probably better to switch… …except that this fork doesn't even try to have Visual Studio projects to begin with, and with MSBuild, you're better off supplying your own project files anyway. As for why we're not just using the Win32 makefile provided by zlib-ng: It's impossible to integrate Makefiles into .sln projects and I just like my locally personalized builds too much. ☺ (And yes, "Makefile projects" are pretty much the same as regular MSBuild projects, except with the NMake calls as part of the XML. The horror.)
1 parent 461ad92 commit 446a768

11 files changed

+167
-10
lines changed
 

Diff for: ‎.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
[submodule "libpng"]
88
path = libpng
99
url = http://git.code.sf.net/p/libpng/code
10-
[submodule "zlib"]
11-
path = zlib
12-
url = https://github.com/madler/zlib.git
10+
[submodule "zlib-ng"]
11+
path = libs/zlib-ng
12+
url = https://github.com/Dead2/zlib-ng

Diff for: ‎base.props

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
66
<PropertyGroup>
7+
<TargetName Condition="$(UseDebugLibraries)!=true">$(RootNamespace)</TargetName>
8+
<TargetName Condition="$(UseDebugLibraries)==true">$(RootNamespace)_d</TargetName>
79
<TargetName Condition="'$(Configuration)'=='Debug'">$(RootNamespace)_d</TargetName>
810
</PropertyGroup>
911
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1012
<PropertyGroup Label="Configuration">
1113
<PlatformToolset>v120_xp</PlatformToolset>
1214
<OutDir>$(SolutionDir)bin\</OutDir>
13-
<IntDir>$(SolutionDir)obj\$(RootNamespace) $(Configuration) Dynamic $(PlatformShortName)\</IntDir>
15+
<IntDir>$(SolutionDir)obj\$(RootNamespace) $(Configuration) $(PlatformShortName)\</IntDir>
1416
</PropertyGroup>
1517
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
1618
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

Diff for: ‎libs/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Automatically copied into this directory at build time.
2+
zconf.h
3+
zlib.h

Diff for: ‎libs/zlib-ng

Submodule zlib-ng added at 92d1a83

Diff for: ‎libs/zlib-ng.vcxproj

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<!--
4+
The zlib1 configurations will build a binary compliant with the ZLIB1.DLL
5+
standard (see win32/DLL_FAQ.txt in the original zlib source distribution).
6+
-->
7+
8+
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
9+
<ItemGroup Label="ProjectConfigurations">
10+
<ProjectConfiguration Include="Debug Dynamic zlib1|Win32">
11+
<Configuration>Debug Dynamic zlib1</Configuration>
12+
<Platform>Win32</Platform>
13+
</ProjectConfiguration>
14+
<ProjectConfiguration Include="Debug Static zlib1|Win32">
15+
<Configuration>Debug Static zlib1</Configuration>
16+
<Platform>Win32</Platform>
17+
</ProjectConfiguration>
18+
<ProjectConfiguration Include="Debug Static|Win32">
19+
<Configuration>Debug Static</Configuration>
20+
<Platform>Win32</Platform>
21+
</ProjectConfiguration>
22+
<ProjectConfiguration Include="Debug Dynamic|Win32">
23+
<Configuration>Debug Dynamic</Configuration>
24+
<Platform>Win32</Platform>
25+
</ProjectConfiguration>
26+
<ProjectConfiguration Include="Release Dynamic zlib1|Win32">
27+
<Configuration>Release Dynamic zlib1</Configuration>
28+
<Platform>Win32</Platform>
29+
</ProjectConfiguration>
30+
<ProjectConfiguration Include="Release Static zlib1|Win32">
31+
<Configuration>Release Static zlib1</Configuration>
32+
<Platform>Win32</Platform>
33+
</ProjectConfiguration>
34+
<ProjectConfiguration Include="Release Static|Win32">
35+
<Configuration>Release Static</Configuration>
36+
<Platform>Win32</Platform>
37+
</ProjectConfiguration>
38+
<ProjectConfiguration Include="Release Dynamic|Win32">
39+
<Configuration>Release Dynamic</Configuration>
40+
<Platform>Win32</Platform>
41+
</ProjectConfiguration>
42+
</ItemGroup>
43+
<PropertyGroup Label="Globals">
44+
<ProjectGuid>{EE4A787C-16D5-4192-870F-E1461AFFA469}</ProjectGuid>
45+
<Keyword>Win32Proj</Keyword>
46+
<ConfigurationType Condition="'$(Configuration)'=='Debug Static'">StaticLibrary</ConfigurationType>
47+
<ConfigurationType Condition="'$(Configuration)'=='Debug Static zlib1'">StaticLibrary</ConfigurationType>
48+
<ConfigurationType Condition="'$(Configuration)'=='Release Static'">StaticLibrary</ConfigurationType>
49+
<ConfigurationType Condition="'$(Configuration)'=='Release Static zlib1'">StaticLibrary</ConfigurationType>
50+
<ConfigurationType Condition="'$(Configuration)'=='Debug Dynamic'">DynamicLibrary</ConfigurationType>
51+
<ConfigurationType Condition="'$(Configuration)'=='Debug Dynamic zlib1'">DynamicLibrary</ConfigurationType>
52+
<ConfigurationType Condition="'$(Configuration)'=='Release Dynamic'">DynamicLibrary</ConfigurationType>
53+
<ConfigurationType Condition="'$(Configuration)'=='Release Dynamic zlib1'">DynamicLibrary</ConfigurationType>
54+
55+
<BuildZLib1 Condition="'$(Configuration)'=='Debug Static zlib1'">true</BuildZLib1>
56+
<BuildZLib1 Condition="'$(Configuration)'=='Debug Dynamic zlib1'">true</BuildZLib1>
57+
<BuildZLib1 Condition="'$(Configuration)'=='Release Static zlib1'">true</BuildZLib1>
58+
<BuildZLib1 Condition="'$(Configuration)'=='Release Dynamic zlib1'">true</BuildZLib1>
59+
60+
<UseDebugLibraries Condition="'$(Configuration)'=='Debug Static'">true</UseDebugLibraries>
61+
<UseDebugLibraries Condition="'$(Configuration)'=='Debug Static zlib1'">true</UseDebugLibraries>
62+
<UseDebugLibraries Condition="'$(Configuration)'=='Debug Dynamic'">true</UseDebugLibraries>
63+
<UseDebugLibraries Condition="'$(Configuration)'=='Debug Dynamic zlib1'">true</UseDebugLibraries>
64+
65+
<RootNamespace Condition="'$(BuildZLib1)|$(ConfigurationType)'=='true|StaticLibrary'">zlib</RootNamespace>
66+
<RootNamespace Condition="'$(BuildZLib1)|$(ConfigurationType)'=='true|DynamicLibrary'">zlib1</RootNamespace>
67+
<RootNamespace Condition="$(BuildZLib1)!=true">zlib-ng</RootNamespace>
68+
</PropertyGroup>
69+
<ImportGroup Label="PropertySheets">
70+
<Import Project="$(SolutionDir)\base.props" />
71+
</ImportGroup>
72+
<PropertyGroup>
73+
<LinkIncremental Condition="$(UseDebugLibraries)==true">true</LinkIncremental>
74+
<LinkIncremental Condition="$(UseDebugLibraries)!=true">false</LinkIncremental>
75+
<ExtensionsToDeleteOnClean>$(ProjectDir)\zconf.h;$(ProjectDir)\zlib.h;$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
76+
</PropertyGroup>
77+
<ItemDefinitionGroup>
78+
<PreBuildEvent>
79+
<Command>
80+
copy /y $(ProjectDir)\zlib-ng\zconf.h.in $(ProjectDir)\zconf.h
81+
copy /y $(ProjectDir)\zlib-ng\zlib.h $(ProjectDir)\
82+
%(Command)</Command>
83+
</PreBuildEvent>
84+
<ClCompile>
85+
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
86+
<PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
87+
<PreprocessorDefinitions Condition="$(BuildZLib1)==true">WITH_GZFILEOP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
88+
<Optimization Condition="$(UseDebugLibraries)!=true">Full</Optimization>
89+
</ClCompile>
90+
<Lib>
91+
<TargetMachine Condition="'$(Platform)'=='Win32'">MachineX86</TargetMachine>
92+
</Lib>
93+
<Link>
94+
<SubSystem>Windows</SubSystem>
95+
<OptimizeReferences Condition="$(UseDebugLibraries)==true">false</OptimizeReferences>
96+
<OptimizeReferences Condition="$(UseDebugLibraries)!=true">true</OptimizeReferences>
97+
<ModuleDefinitionFile Condition="$(BuildZLib1)==true">zlib-ng\win32\zlibcompat.def</ModuleDefinitionFile>
98+
<ModuleDefinitionFile Condition="$(BuildZLib1)!=true">zlib-ng\win32\zlib.def</ModuleDefinitionFile>
99+
<ImportLibrary>$(OutDir)zdll</ImportLibrary>
100+
<ImportLibrary Condition="$(BuildZLib1)!=true">%(ImportLibrary)-ng</ImportLibrary>
101+
<ImportLibrary Condition="$(UseDebugLibraries)==true">%(ImportLibrary)_d</ImportLibrary>
102+
<ImportLibrary>%(ImportLibrary).lib</ImportLibrary>
103+
</Link>
104+
</ItemDefinitionGroup>
105+
<ItemGroup>
106+
<ClCompile Include="zlib-ng\adler32.c" />
107+
<ClCompile Include="zlib-ng\compress.c" />
108+
<ClCompile Include="zlib-ng\crc32.c" />
109+
<ClCompile Include="zlib-ng\deflate.c" />
110+
<ClCompile Include="zlib-ng\gzclose.c">
111+
<ExcludedFromBuild Condition="$(BuildZLib1)!=true">true</ExcludedFromBuild>
112+
</ClCompile>
113+
<ClCompile Include="zlib-ng\gzlib.c">
114+
<ExcludedFromBuild Condition="$(BuildZLib1)!=true">true</ExcludedFromBuild>
115+
</ClCompile>
116+
<ClCompile Include="zlib-ng\gzread.c">
117+
<ExcludedFromBuild Condition="$(BuildZLib1)!=true">true</ExcludedFromBuild>
118+
</ClCompile>
119+
<ClCompile Include="zlib-ng\gzwrite.c">
120+
<ExcludedFromBuild Condition="$(BuildZLib1)!=true">true</ExcludedFromBuild>
121+
</ClCompile>
122+
<ClCompile Include="zlib-ng\infback.c" />
123+
<ClCompile Include="zlib-ng\inffast.c" />
124+
<ClCompile Include="zlib-ng\inflate.c" />
125+
<ClCompile Include="zlib-ng\inftrees.c" />
126+
<ClCompile Include="zlib-ng\match.c" />
127+
<ClCompile Include="zlib-ng\trees.c" />
128+
<ClCompile Include="zlib-ng\uncompr.c" />
129+
<ClCompile Include="zlib-ng\zutil.c" />
130+
<None Include="zlib-ng\crc32.h" />
131+
<None Include="zlib-ng\deflate.h" />
132+
<None Include="zlib-ng\gzguts.h" />
133+
<None Include="zlib-ng\inffast.h" />
134+
<None Include="zlib-ng\inffixed.h" />
135+
<None Include="zlib-ng\inflate.h" />
136+
<None Include="zlib-ng\inftrees.h" />
137+
<None Include="zlib-ng\match.h" />
138+
<None Include="zlib-ng\trees.h" />
139+
<None Include="zlib-ng\zutil.h" />
140+
<None Include="zconf.h" />
141+
<ResourceCompile Include="zlib-ng\win32\zlib1.rc" />
142+
<None Include="zlib-ng\win32\zlib.def" />
143+
</ItemGroup>
144+
</Project>

Diff for: ‎thcrap.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ImportGroup>
1111
<ItemDefinitionGroup>
1212
<ClCompile>
13-
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)zlib\;$(SolutionDir)thcrap\src\;$(SolutionDir)win32_utf8\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
13+
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)libs/;$(SolutionDir)thcrap/src/;$(SolutionDir)win32_utf8/src/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
1414
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
1515
</ClCompile>
1616
</ItemDefinitionGroup>

Diff for: ‎thcrap.sln

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thcrap_loader", "thcrap_loa
1212
EndProject
1313
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thcrap", "thcrap/thcrap.vcxproj", "{8D7455CC-BE95-4F59-9047-D390454C7261}"
1414
ProjectSection(ProjectDependencies) = postProject
15+
{EE4A787C-16D5-4192-870F-E1461AFFA469} = {EE4A787C-16D5-4192-870F-E1461AFFA469}
1516
{A185D5A7-3E03-4C87-9774-65C014631F5B} = {A185D5A7-3E03-4C87-9774-65C014631F5B}
1617
EndProjectSection
1718
EndProject
@@ -22,6 +23,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thcrap_tsa", "thcrap_tsa/th
2223
EndProject
2324
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thcrap_update", "thcrap_update/thcrap_update.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
2425
ProjectSection(ProjectDependencies) = postProject
26+
{EE4A787C-16D5-4192-870F-E1461AFFA469} = {EE4A787C-16D5-4192-870F-E1461AFFA469}
2527
{8D7455CC-BE95-4F59-9047-D390454C7261} = {8D7455CC-BE95-4F59-9047-D390454C7261}
2628
EndProjectSection
2729
EndProject
@@ -33,6 +35,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thcrap_configure", "thcrap_
3335
EndProject
3436
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32_utf8", "win32_utf8/win32_utf8.vcxproj", "{A185D5A7-3E03-4C87-9774-65C014631F5B}"
3537
EndProject
38+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib-ng", "libs/zlib-ng.vcxproj", "{EE4A787C-16D5-4192-870F-E1461AFFA469}"
39+
EndProject
3640
Global
3741
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3842
Debug|Win32 = Debug|Win32
@@ -63,6 +67,10 @@ Global
6367
{A185D5A7-3E03-4C87-9774-65C014631F5B}.Debug|Win32.Build.0 = Debug Dynamic|Win32
6468
{A185D5A7-3E03-4C87-9774-65C014631F5B}.Release|Win32.ActiveCfg = Release Dynamic|Win32
6569
{A185D5A7-3E03-4C87-9774-65C014631F5B}.Release|Win32.Build.0 = Release Dynamic|Win32
70+
{EE4A787C-16D5-4192-870F-E1461AFFA469}.Debug|Win32.ActiveCfg = Debug Dynamic|Win32
71+
{EE4A787C-16D5-4192-870F-E1461AFFA469}.Debug|Win32.Build.0 = Debug Dynamic|Win32
72+
{EE4A787C-16D5-4192-870F-E1461AFFA469}.Release|Win32.ActiveCfg = Release Dynamic|Win32
73+
{EE4A787C-16D5-4192-870F-E1461AFFA469}.Release|Win32.Build.0 = Release Dynamic|Win32
6674
EndGlobalSection
6775
GlobalSection(SolutionProperties) = preSolution
6876
HideSolutionNode = FALSE

Diff for: ‎thcrap_d.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Optimization>Disabled</Optimization>
1212
</ClCompile>
1313
<Link>
14-
<AdditionalDependencies>win32_utf8_dynamic_x86_debug.lib;jansson_d.lib;zlib1d.lib;%(AdditionalDependencies)</AdditionalDependencies>
14+
<AdditionalDependencies>win32_utf8_dynamic_x86_debug.lib;jansson_d.lib;zdll-ng_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
1515
</Link>
1616
</ItemDefinitionGroup>
1717
</Project>

Diff for: ‎thcrap_r.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Link>
1414
<OptimizeReferences>true</OptimizeReferences>
1515
<StringPooling>true</StringPooling>
16-
<AdditionalDependencies>win32_utf8_dynamic_x86.lib;jansson.lib;zlib1.lib;%(AdditionalDependencies)</AdditionalDependencies>
16+
<AdditionalDependencies>win32_utf8_dynamic_x86.lib;jansson.lib;zdll-ng.lib;%(AdditionalDependencies)</AdditionalDependencies>
1717
<EnableCOMDATFolding>true</EnableCOMDATFolding>
1818
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
1919
</Link>

Diff for: ‎thcrap_update/thcrap_update.vcxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
<SubSystem>Windows</SubSystem>
3030
<ModuleDefinitionFile>thcrap_update.def</ModuleDefinitionFile>
3131
<AdditionalDependencies>crypt32.lib;wininet.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
32-
<AdditionalDependencies Condition="'$(Configuration)'=='Debug'">thcrap_d.lib;zlib1d.lib;%(AdditionalDependencies)</AdditionalDependencies>
33-
<AdditionalDependencies Condition="'$(Configuration)'=='Release'">thcrap.lib;zlib1.lib;%(AdditionalDependencies)</AdditionalDependencies>
32+
<AdditionalDependencies Condition="'$(Configuration)'=='Debug'">thcrap_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
33+
<AdditionalDependencies Condition="'$(Configuration)'=='Release'">thcrap.lib;%(AdditionalDependencies)</AdditionalDependencies>
3434
</Link>
3535
</ItemDefinitionGroup>
3636
<ItemGroup>

Diff for: ‎zlib

-1
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.