1<?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">
4    <ProjectConfiguration Include="Release|Win32">
5      <Configuration>Release</Configuration>
6      <Platform>Win32</Platform>
7    </ProjectConfiguration>
8    <ProjectConfiguration Include="Release|x64">
9      <Configuration>Release</Configuration>
10      <Platform>x64</Platform>
11    </ProjectConfiguration>
12    <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>
20  </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" />
27
28  <PropertyGroup Label="Configuration" Condition="$(Platform) == 'Win32'">
29    <ConfigurationType>Makefile</ConfigurationType>
30    <Bitness>32</Bitness>
31    <ArchName>x86</ArchName>
32    <OpenSSLPlatform>VC-WIN32</OpenSSLPlatform>
33    <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>
57    <SupportSigning>true</SupportSigning>
58  </PropertyGroup>
59
60  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
61  <Import Project="pyproject.props" />
62
63  <PropertyGroup>
64    <IntDir>$(opensslDir)\tmp$(Bitness)dll</IntDir>
65    <OutDir>$(opensslOutDir)</OutDir>
66    <NMakeBuildCommandLine>setlocal
67set VCINSTALLDIR=$(VCInstallDir)
68if not exist "$(IntDir.TrimEnd('\'))" mkdir "$(IntDir.TrimEnd('\'))"
69cd /D "$(IntDir.TrimEnd('\'))"
70$(Perl) "$(opensslDir)\configure" $(OpenSSLPlatform) no-asm
71nmake
72</NMakeBuildCommandLine>
73  </PropertyGroup>
74
75  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
76
77  <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)" />
97  </Target>
98
99  <Target Name="_CopyToOutput" AfterTargets="Build">
100    <ItemGroup>
101      <_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" />
107    </ItemGroup>
108    <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" />
112  </Target>
113
114  <Target Name="SignFiles" AfterTargets="Build" Condition="$(_SignCommand) != ''">
115    <ItemGroup>
116      <FilesToSign Include="$(opensslOutDir)\lib*.dll" />
117    </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>