blob: 0da6f6749584f15f77fb2202baf7dbcbf29e5c18 [file] [log] [blame]
Steve Dower68d663c2017-07-17 11:15:48 +02001<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ItemGroup Label="ProjectConfigurations">
Steve Dower68d663c2017-07-17 11:15:48 +02004 <ProjectConfiguration Include="Release|Win32">
5 <Configuration>Release</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
Steve Dower68d663c2017-07-17 11:15:48 +02008 <ProjectConfiguration Include="Release|x64">
9 <Configuration>Release</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
Paul Monsonfb7e7502019-05-15 15:38:55 -070012 <ProjectConfiguration Include="Release|ARM">
13 <Configuration>Release</Configuration>
14 <Platform>ARM</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="Release|ARM64">
17 <Configuration>Release</Configuration>
18 <Platform>ARM64</Platform>
19 </ProjectConfiguration>
Steve Dower68d663c2017-07-17 11:15:48 +020020 </ItemGroup>
21 <PropertyGroup Label="Globals">
22 <ProjectGuid>{B5FD6F1D-129E-4BFF-9340-03606FAC7283}</ProjectGuid>
23 </PropertyGroup>
24
25 <Import Project="python.props" />
26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Paul Monsonfb7e7502019-05-15 15:38:55 -070027
28 <PropertyGroup Label="Configuration" Condition="$(Platform) == 'Win32'">
Steve Dower68d663c2017-07-17 11:15:48 +020029 <ConfigurationType>Makefile</ConfigurationType>
30 <Bitness>32</Bitness>
Steve Dower68d663c2017-07-17 11:15:48 +020031 <ArchName>x86</ArchName>
Steve Dowerb84bcc42017-09-09 06:13:06 -070032 <OpenSSLPlatform>VC-WIN32</OpenSSLPlatform>
Paul Monsonfb7e7502019-05-15 15:38:55 -070033 <SupportSigning>true</SupportSigning>
34 </PropertyGroup>
35
36 <PropertyGroup Label="Configuration" Condition="$(Platform) == 'x64'">
37 <ConfigurationType>Makefile</ConfigurationType>
38 <Bitness>64</Bitness>
39 <ArchName>amd64</ArchName>
40 <OpenSSLPlatform>VC-WIN64A-masm</OpenSSLPlatform>
41 <SupportSigning>true</SupportSigning>
42 </PropertyGroup>
43
44 <PropertyGroup Label="Configuration" Condition="$(Platform) == 'ARM'">
45 <ConfigurationType>Makefile</ConfigurationType>
46 <Bitness>ARM</Bitness>
47 <ArchName>ARM</ArchName>
48 <OpenSSLPlatform>VC-WIN32-ARM</OpenSSLPlatform>
49 <SupportSigning>true</SupportSigning>
50 </PropertyGroup>
51
52 <PropertyGroup Label="Configuration" Condition="$(Platform) == 'ARM64'">
53 <ConfigurationType>Makefile</ConfigurationType>
54 <Bitness>ARM64</Bitness>
55 <ArchName>ARM64</ArchName>
56 <OpenSSLPlatform>VC-WIN64-ARM</OpenSSLPlatform>
Steve Dower68d663c2017-07-17 11:15:48 +020057 <SupportSigning>true</SupportSigning>
58 </PropertyGroup>
59
Steve Dower68d663c2017-07-17 11:15:48 +020060 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
61 <Import Project="pyproject.props" />
62
63 <PropertyGroup>
64 <IntDir>$(opensslDir)\tmp$(Bitness)dll</IntDir>
Steve Dowerb84bcc42017-09-09 06:13:06 -070065 <OutDir>$(opensslOutDir)</OutDir>
Steve Dower68d663c2017-07-17 11:15:48 +020066 <NMakeBuildCommandLine>setlocal
Steve Dower68d663c2017-07-17 11:15:48 +020067set VCINSTALLDIR=$(VCInstallDir)
Steve Dower68d663c2017-07-17 11:15:48 +020068if not exist "$(IntDir.TrimEnd('\'))" mkdir "$(IntDir.TrimEnd('\'))"
Steve Dowerb84bcc42017-09-09 06:13:06 -070069cd /D "$(IntDir.TrimEnd('\'))"
70$(Perl) "$(opensslDir)\configure" $(OpenSSLPlatform) no-asm
71nmake
Steve Dower68d663c2017-07-17 11:15:48 +020072</NMakeBuildCommandLine>
73 </PropertyGroup>
74
75 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
76
Steve Dowerb84bcc42017-09-09 06:13:06 -070077 <Target Name="_PatchUplink" BeforeTargets="Build">
78 <PropertyGroup>
79 <Uplink>$(opensslDir)\ms\uplink.c</Uplink>
80 <BeforePatch>((h = GetModuleHandle(NULL)) == NULL)</BeforePatch>
81 <AfterPatch>((h = GetModuleHandleA("_ssl.pyd")) == NULL) if ((h = GetModuleHandleA("_ssl_d.pyd")) == NULL) if ((h = GetModuleHandle(NULL)) == NULL /*patched*/)</AfterPatch>
82 </PropertyGroup>
83 <Error Text="Cannot find $(Uplink)" Condition="!Exists($(Uplink))" />
84 <PropertyGroup>
85 <_Original>$([System.IO.File]::ReadAllText($(Uplink)))</_Original>
86 <_Patched>$(_Original.Replace($(BeforePatch), $(AfterPatch)))</_Patched>
87 <IsPatched>false</IsPatched>
88 <IsPatched Condition="$(_Patched) == $(_Original)">true</IsPatched>
89 </PropertyGroup>
90 <Message Text="$(Uplink) is already patched" Importance="normal" Condition="$(IsPatched)" />
91 <Message Text="Patching $(Uplink)" Importance="high" Condition="!$(IsPatched)" />
92 <WriteLinesToFile File="$(Uplink)"
93 Lines="$(_Patched)"
94 Overwrite="true"
95 Encoding="ASCII"
96 Condition="!$(IsPatched)" />
Steve Dower68d663c2017-07-17 11:15:48 +020097 </Target>
98
Steve Dowerb84bcc42017-09-09 06:13:06 -070099 <Target Name="_CopyToOutput" AfterTargets="Build">
Steve Dower68d663c2017-07-17 11:15:48 +0200100 <ItemGroup>
Steve Dowerb84bcc42017-09-09 06:13:06 -0700101 <_Built Include="$(opensslDir)\LICENSE" />
102 <_Built Include="$(IntDir)\libcrypto.lib;$(IntDir)\libcrypto-*.dll;$(IntDir)\libcrypto-*.pdb" />
103 <_Built Include="$(IntDir)\libssl.lib;$(IntDir)\libssl-*.dll;$(IntDir)\libssl-*.pdb" />
104 <_AppLink Include="$(opensslDir)\ms\applink.c" />
105 <_Include Include="$(opensslDir)\Include\openssl\*.h" />
106 <_Include Include="$(IntDir)\include\openssl\*.h" />
Steve Dower68d663c2017-07-17 11:15:48 +0200107 </ItemGroup>
Steve Dowerb84bcc42017-09-09 06:13:06 -0700108 <MakeDir Directories="$(opensslOutDir)\include\openssl" />
109 <Copy SourceFiles="@(_Built)" DestinationFolder="$(opensslOutDir)" />
110 <Copy SourceFiles="@(_AppLink)" DestinationFolder="$(opensslOutDir)\include" />
111 <Copy SourceFiles="@(_Include)" DestinationFolder="$(opensslOutDir)\include\openssl" />
Steve Dower68d663c2017-07-17 11:15:48 +0200112 </Target>
113
114 <Target Name="SignFiles" AfterTargets="Build" Condition="$(_SignCommand) != ''">
115 <ItemGroup>
Steve Dowerb84bcc42017-09-09 06:13:06 -0700116 <FilesToSign Include="$(opensslOutDir)\lib*.dll" />
Steve Dower68d663c2017-07-17 11:15:48 +0200117 </ItemGroup>
118 <Exec Command="$(_SignCommand) %(FilesToSign.FullPath)" ContinueOnError="true" />
119 </Target>
120
121 <Target Name="Clean" />
122 <Target Name="CleanAll">
123 <Delete Files="$(TargetPath);$(BuildPath)$(tclDLLName)" />
124 <RemoveDir Directories="$(IntDir)" />
125 </Target>
126
127 <Target Name="LocateNMake">
128 <PropertyGroup>
129 <OutputFilename Condition="$(OutputFilename) == ''">$(Temp)\nmake.loc</OutputFilename>
130 </PropertyGroup>
131 <ItemGroup>
132 <_NMakeExe Include="$(VC_ExecutablePath_x86_x86)\nmake.exe" Condition="$(VC_ExecutablePath_x86_x86) != ''" />
133 </ItemGroup>
134 <MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(OutputFilename)))" />
135 <WriteLinesToFile File="$(OutputFilename)" Lines="@(_NMakeExe)" />
136 </Target>
137
138 <Target Name="ResolveAssemblyReferences" />
139</Project>