Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 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"> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 4 | <ProjectConfiguration Include="Release|Win32"> |
| 5 | <Configuration>Release</Configuration> |
| 6 | <Platform>Win32</Platform> |
| 7 | </ProjectConfiguration> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 8 | <ProjectConfiguration Include="Release|x64"> |
| 9 | <Configuration>Release</Configuration> |
| 10 | <Platform>x64</Platform> |
| 11 | </ProjectConfiguration> |
Paul Monson | fb7e750 | 2019-05-15 15:38:55 -0700 | [diff] [blame] | 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> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 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" /> |
Paul Monson | fb7e750 | 2019-05-15 15:38:55 -0700 | [diff] [blame] | 27 | |
| 28 | <PropertyGroup Label="Configuration" Condition="$(Platform) == 'Win32'"> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 29 | <ConfigurationType>Makefile</ConfigurationType> |
| 30 | <Bitness>32</Bitness> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 31 | <ArchName>x86</ArchName> |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 32 | <OpenSSLPlatform>VC-WIN32</OpenSSLPlatform> |
Paul Monson | fb7e750 | 2019-05-15 15:38:55 -0700 | [diff] [blame] | 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> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 57 | <SupportSigning>true</SupportSigning> |
| 58 | </PropertyGroup> |
| 59 | |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 60 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
| 61 | <Import Project="pyproject.props" /> |
| 62 | |
| 63 | <PropertyGroup> |
| 64 | <IntDir>$(opensslDir)\tmp$(Bitness)dll</IntDir> |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 65 | <OutDir>$(opensslOutDir)</OutDir> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 66 | <NMakeBuildCommandLine>setlocal |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 67 | set VCINSTALLDIR=$(VCInstallDir) |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 68 | if not exist "$(IntDir.TrimEnd('\'))" mkdir "$(IntDir.TrimEnd('\'))" |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 69 | cd /D "$(IntDir.TrimEnd('\'))" |
| 70 | $(Perl) "$(opensslDir)\configure" $(OpenSSLPlatform) no-asm |
| 71 | nmake |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 72 | </NMakeBuildCommandLine> |
| 73 | </PropertyGroup> |
| 74 | |
| 75 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
| 76 | |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 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)" /> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 97 | </Target> |
| 98 | |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 99 | <Target Name="_CopyToOutput" AfterTargets="Build"> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 100 | <ItemGroup> |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 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" /> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 107 | </ItemGroup> |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 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" /> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 112 | </Target> |
| 113 | |
| 114 | <Target Name="SignFiles" AfterTargets="Build" Condition="$(_SignCommand) != ''"> |
| 115 | <ItemGroup> |
Steve Dower | b84bcc4 | 2017-09-09 06:13:06 -0700 | [diff] [blame] | 116 | <FilesToSign Include="$(opensslOutDir)\lib*.dll" /> |
Steve Dower | 68d663c | 2017-07-17 11:15:48 +0200 | [diff] [blame] | 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> |