FS-11087: [Build-System] Use shared zlib library on Windows.
This commit is contained in:
parent
e47a6922b3
commit
07fbd3fc49
|
@ -24,8 +24,8 @@
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>libpng</RootNamespace>
|
<RootNamespace>libpng</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(ProjectDir)..\..\..\w32\zlib.props" />
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<Import Project="$(SolutionDir)w32\zlib.props" Condition=" '$(zlibImported)' == '' "/>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<Import Project="curl-version.props" Condition=" '$(curlVersionImported)' == '' "/>
|
<Import Project="curl-version.props" Condition=" '$(curlVersionImported)' == '' "/>
|
||||||
<Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
|
<Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
|
||||||
<Import Project="openssl.props" />
|
<Import Project="openssl.props" />
|
||||||
<Import Project="zlib.props" />
|
<Import Project="zlib.props" Condition=" '$(zlibImported)' == '' "/>
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<CurlPropsImported>true</CurlPropsImported>
|
<CurlPropsImported>true</CurlPropsImported>
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<zlibImported>true</zlibImported>
|
||||||
|
</PropertyGroup>
|
||||||
<ImportGroup Label="PropertySheets">
|
<ImportGroup Label="PropertySheets">
|
||||||
<Import Project="zlib-version.props" Condition=" '$(zlibVersionImported)' == '' "/>
|
<Import Project="zlib-version.props" Condition=" '$(zlibVersionImported)' == '' "/>
|
||||||
<Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
|
<Import Project="downloadpackage.task" Condition=" '$(downloadpackagetask_Imported)' == '' " />
|
||||||
|
@ -8,10 +11,12 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<LibraryConfiguration Condition="$(Configuration.ToLower().Contains('debug'))">Debug</LibraryConfiguration>
|
<LibraryConfiguration Condition="$(Configuration.ToLower().Contains('debug'))">Debug</LibraryConfiguration>
|
||||||
<LibraryConfiguration Condition="$(Configuration.ToLower().Contains('release'))">Release</LibraryConfiguration>
|
<LibraryConfiguration Condition="$(Configuration.ToLower().Contains('release'))">Release</LibraryConfiguration>
|
||||||
|
<LibraryFileName Condition=" '$(LibraryConfiguration)' == 'Debug' ">zlibd</LibraryFileName>
|
||||||
|
<LibraryFileName Condition=" '$(LibraryConfiguration)' == 'Release' ">zlib</LibraryFileName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Label="UserMacros">
|
<PropertyGroup Label="UserMacros">
|
||||||
<zliblibDir>$(BaseDir)libs\zlib-$(zlibVersion)</zliblibDir>
|
<zlibLibDir>$(BaseDir)libs\zlib-$(zlibVersion)</zlibLibDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -37,7 +42,7 @@
|
||||||
<Target Name="zlibBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
<Target Name="zlibBinariesDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
||||||
<DownloadPackageTask
|
<DownloadPackageTask
|
||||||
package="http://files.freeswitch.org/windows/packages/zlib/$(zlibVersion)/zlib-$(zlibVersion)-binaries-$(Platform.ToLower())-$(LibraryConfiguration.ToLower()).zip"
|
package="http://files.freeswitch.org/windows/packages/zlib/$(zlibVersion)/zlib-$(zlibVersion)-binaries-$(Platform.ToLower())-$(LibraryConfiguration.ToLower()).zip"
|
||||||
expectfileordirectory="$(zliblibDir)\binaries\$(Platform)\$(LibraryConfiguration)\zlib.lib"
|
expectfileordirectory="$(zlibLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\lib\$(LibraryFileName).lib"
|
||||||
outputfolder=""
|
outputfolder=""
|
||||||
outputfilename=""
|
outputfilename=""
|
||||||
extractto="$(BaseDir)libs\"
|
extractto="$(BaseDir)libs\"
|
||||||
|
@ -46,21 +51,31 @@
|
||||||
<Target Name="zlibHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
<Target Name="zlibHeadersDownloadTarget" BeforeTargets="CustomBuild" DependsOnTargets="7za">
|
||||||
<DownloadPackageTask
|
<DownloadPackageTask
|
||||||
package="http://files.freeswitch.org/windows/packages/zlib/$(zlibVersion)/zlib-$(zlibVersion)-headers.zip"
|
package="http://files.freeswitch.org/windows/packages/zlib/$(zlibVersion)/zlib-$(zlibVersion)-headers.zip"
|
||||||
expectfileordirectory="$(zliblibDir)\include\zlib.h"
|
expectfileordirectory="$(zlibLibDir)\include\zlib.h"
|
||||||
outputfolder=""
|
outputfolder=""
|
||||||
outputfilename=""
|
outputfilename=""
|
||||||
extractto="$(BaseDir)libs\"
|
extractto="$(BaseDir)libs\"
|
||||||
/>
|
/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="zlibcopyTarget" BeforeTargets="CustomBuild" DependsOnTargets="zlibBinariesDownloadTarget">
|
||||||
|
<ItemGroup>
|
||||||
|
<zlibFiles Include="$(zlibLibDir)\binaries\$(Platform)\$(LibraryConfiguration)\bin\*.dll" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Copy Condition="!exists('$(BaseDir)$(Platform)\$(LibraryConfiguration)\$(LibraryFileName).dll')"
|
||||||
|
SourceFiles="@(zlibFiles)"
|
||||||
|
DestinationFiles="@(zlibFiles->'$(BaseDir)$(Platform)\$(LibraryConfiguration)\%(Filename)%(Extension)')"
|
||||||
|
/>
|
||||||
|
</Target>
|
||||||
|
|
||||||
<ItemDefinitionGroup>
|
<ItemDefinitionGroup>
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir)libs\zlib-$(zlibVersion)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir)libs\zlib-$(zlibVersion)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>HAVE_ZLIB;ZLIB_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>HAVE_ZLIB;ZLIB_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<AdditionalLibraryDirectories>$(SolutionDir)libs\zlib-$(zlibVersion)\binaries\$(Platform)\$(LibraryConfiguration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(SolutionDir)libs\zlib-$(zlibVersion)\binaries\$(Platform)\$(LibraryConfiguration)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>$(LibraryFileName).lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue