Steve Dower | 21a92f8 | 2019-06-14 08:29:20 -0700 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Py_IntDir"> |
| 3 | <Import Project="python.props" Condition="$(__Python_Props_Imported) != 'true'" /> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 4 | <PropertyGroup Label="Globals"> |
Steve Dower | 21a92f8 | 2019-06-14 08:29:20 -0700 | [diff] [blame] | 5 | <__PyProject_Props_Imported>true</__PyProject_Props_Imported> |
Stefan Krah | 318c56c | 2012-06-24 19:04:35 +0200 | [diff] [blame] | 6 | <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 7 | <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> |
| 8 | <OutDir>$(BuildPath)</OutDir> |
Steve Dower | de9fb28 | 2015-07-27 14:56:58 -0700 | [diff] [blame] | 9 | <OutDir Condition="!HasTrailingSlash($(OutDir))">$(OutDir)\</OutDir> |
Steve Dower | 6ed63f3 | 2016-07-24 18:03:22 -0700 | [diff] [blame] | 10 | <Py_IntDir Condition="'$(Py_IntDir)' == ''">$(MSBuildThisFileDirectory)obj\</Py_IntDir> |
Steve Dower | 2084b30 | 2017-10-05 13:35:36 -0700 | [diff] [blame] | 11 | <IntDir>$(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\$(ProjectName)\</IntDir> |
Steve Dower | 0d2a908 | 2017-11-04 16:28:47 -0700 | [diff] [blame] | 12 | <IntDir>$(IntDir.Replace(`\\`, `\`))</IntDir> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 13 | <TargetName Condition="'$(TargetName)' == ''">$(ProjectName)</TargetName> |
| 14 | <TargetName>$(TargetName)$(PyDebugExt)</TargetName> |
| 15 | <GenerateManifest>false</GenerateManifest> |
| 16 | <EmbedManifest>false</EmbedManifest> |
| 17 | <SupportPGO Condition="'$(SupportPGO)' == ''">true</SupportPGO> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 18 | <SupportSigning Condition="'$(SupportSigning)' == ''">true</SupportSigning> |
| 19 | <SupportSigning Condition="'$(Configuration)' == 'Debug'">false</SupportSigning> |
| 20 | <SupportSigning Condition="'$(ConfigurationType)' == 'StaticLibrary'">false</SupportSigning> |
Zachary Ware | 6373ba5 | 2014-03-17 15:57:38 -0500 | [diff] [blame] | 21 | </PropertyGroup> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 22 | |
| 23 | <PropertyGroup> |
| 24 | <_DebugPreprocessorDefinition>NDEBUG;</_DebugPreprocessorDefinition> |
| 25 | <_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG;</_DebugPreprocessorDefinition> |
| 26 | <_PlatformPreprocessorDefinition>_WIN32;</_PlatformPreprocessorDefinition> |
| 27 | <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64;</_PlatformPreprocessorDefinition> |
| 28 | <_PydPreprocessorDefinition Condition="$(TargetExt) == '.pyd'">Py_BUILD_CORE_MODULE;</_PydPreprocessorDefinition> |
Steve Dower | dcbaa1b | 2020-07-06 17:32:00 +0100 | [diff] [blame] | 29 | <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)";</_Py3NamePreprocessorDefinition> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 30 | </PropertyGroup> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 31 | <ItemDefinitionGroup> |
| 32 | <ClCompile> |
Victor Stinner | 27e2d1f | 2018-11-01 00:52:28 +0100 | [diff] [blame] | 33 | <AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
Steve Dower | dcbaa1b | 2020-07-06 17:32:00 +0100 | [diff] [blame] | 34 | <PreprocessorDefinitions>WIN32;$(_Py3NamePreprocessorDefinition);$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> |
Steve Dower | 21a92f8 | 2019-06-14 08:29:20 -0700 | [diff] [blame] | 35 | |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 36 | <Optimization>MaxSpeed</Optimization> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 37 | <IntrinsicFunctions>true</IntrinsicFunctions> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 38 | <StringPooling>true</StringPooling> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 39 | <ExceptionHandling></ExceptionHandling> |
Steve Dower | fcbe1df | 2015-09-08 21:39:01 -0700 | [diff] [blame] | 40 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 41 | <FunctionLevelLinking>true</FunctionLevelLinking> |
| 42 | <WarningLevel>Level3</WarningLevel> |
| 43 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
| 44 | <CompileAs>Default</CompileAs> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 45 | <SuppressStartupBanner>true</SuppressStartupBanner> |
| 46 | <WholeProgramOptimization>true</WholeProgramOptimization> |
Victor Stinner | a05bef4 | 2018-10-26 15:10:29 +0200 | [diff] [blame] | 47 | <InlineFunctionExpansion Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OnlyExplicitInline</InlineFunctionExpansion> |
| 48 | <InlineFunctionExpansion Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">OnlyExplicitInline</InlineFunctionExpansion> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 49 | </ClCompile> |
| 50 | <ClCompile Condition="$(Configuration) == 'Debug'"> |
| 51 | <Optimization>Disabled</Optimization> |
| 52 | <WholeProgramOptimization>false</WholeProgramOptimization> |
Steve Dower | fcbe1df | 2015-09-08 21:39:01 -0700 | [diff] [blame] | 53 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 54 | </ClCompile> |
Zachary Ware | 4c5ad94 | 2016-01-29 19:08:55 -0600 | [diff] [blame] | 55 | <ClCompile Condition="$(ICCBuild) == 'true'"> |
| 56 | <FloatingPointModel>Strict</FloatingPointModel> |
| 57 | </ClCompile> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 58 | <Link> |
| 59 | <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
| 60 | <GenerateDebugInformation>true</GenerateDebugInformation> |
| 61 | <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile> |
| 62 | <SubSystem>Windows</SubSystem> |
Christian Heimes | f3bf35e | 2013-11-20 17:43:23 +0100 | [diff] [blame] | 63 | <RandomizedBaseAddress>true</RandomizedBaseAddress> |
| 64 | <DataExecutionPrevention>true</DataExecutionPrevention> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 65 | <SuppressStartupBanner>true</SuppressStartupBanner> |
Steve Dower | fcbe1df | 2015-09-08 21:39:01 -0700 | [diff] [blame] | 66 | <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 67 | <TargetMachine>MachineX86</TargetMachine> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 68 | <TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine> |
Paul Monson | 8a1657b | 2019-02-14 08:31:30 -0800 | [diff] [blame] | 69 | <TargetMachine Condition="'$(Platform)'=='ARM'">MachineARM</TargetMachine> |
Paul Monson | f96e7fd | 2019-05-17 10:07:24 -0700 | [diff] [blame] | 70 | <TargetMachine Condition="'$(Platform)'=='ARM64'">MachineARM64</TargetMachine> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 71 | <ProfileGuidedDatabase Condition="$(SupportPGO)">$(OutDir)$(TargetName).pgd</ProfileGuidedDatabase> |
| 72 | <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration> |
| 73 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">PGInstrument</LinkTimeCodeGeneration> |
| 74 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration> |
Paul Monson | 8a1657b | 2019-02-14 08:31:30 -0800 | [diff] [blame] | 75 | <AdditionalDependencies>advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 76 | </Link> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 77 | <Lib> |
| 78 | <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration> |
| 79 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">true</LinkTimeCodeGeneration> |
| 80 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">true</LinkTimeCodeGeneration> |
| 81 | </Lib> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 82 | <ResourceCompile> |
Steve Dower | b066058 | 2016-04-06 12:35:24 -0700 | [diff] [blame] | 83 | <AdditionalIncludeDirectories>$(PySourcePath)PC;$(PySourcePath)Include;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
Nikita Nemkin | 4efc336 | 2020-06-24 00:05:57 +0500 | [diff] [blame] | 84 | <PreprocessorDefinitions>ORIGINAL_FILENAME=\"$(TargetName)$(TargetExt)\";FIELD3=$(Field3Value);$(_DebugPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 85 | <Culture>0x0409</Culture> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 86 | </ResourceCompile> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 87 | <Midl> |
| 88 | <PreprocessorDefinitions>$(_DebugPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 89 | <MkTypLibCompatible>true</MkTypLibCompatible> |
| 90 | <SuppressStartupBanner>true</SuppressStartupBanner> |
| 91 | <TargetEnvironment>Win32</TargetEnvironment> |
| 92 | <TargetEnvironment Condition="'$(Platform)' == 'x64'">X64</TargetEnvironment> |
Steve Dower | df450d1 | 2016-07-16 16:17:33 -0700 | [diff] [blame] | 93 | <OutputDirectory>$(IntDir)</OutputDirectory> |
| 94 | <InterfaceIdentifierFileName>$(MSBuildProjectName)_i.c</InterfaceIdentifierFileName> |
| 95 | <ProxyFileName>$(MSBuildProjectName)_p.c</ProxyFileName> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 96 | </Midl> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 97 | </ItemDefinitionGroup> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 98 | |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 99 | <UsingTask TaskName="KillPython" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> |
| 100 | <ParameterGroup> |
| 101 | <FileName Required="true" /> |
| 102 | </ParameterGroup> |
| 103 | <Task> |
Jeremy Kloth | fa53294 | 2018-10-23 05:41:48 -0600 | [diff] [blame] | 104 | <Using Namespace="System.Diagnostics"/> |
| 105 | <Using Namespace="System.IO"/> |
| 106 | <Using Namespace="System.Runtime.InteropServices"/> |
| 107 | <Using Namespace="System.Text"/> |
| 108 | <Code Type="Method" Language="cs"> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 109 | <![CDATA[ |
Jeremy Kloth | fa53294 | 2018-10-23 05:41:48 -0600 | [diff] [blame] | 110 | [DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Unicode)] |
| 111 | public static extern bool QueryFullProcessImageName([In]IntPtr hProcess, [In]int dwFlags, |
| 112 | [Out]StringBuilder lpExeName, ref int lpdwSize); |
| 113 | public override bool Execute() { |
| 114 | string fullPath = Path.GetFullPath(FileName); |
| 115 | Log.LogMessage("Looking for " + fullPath, MessageImportance.Normal); |
| 116 | foreach (Process p in Process.GetProcesses()) { |
| 117 | try { |
| 118 | int pathLength = 32768; |
| 119 | StringBuilder pathBuilder = new StringBuilder(pathLength); |
| 120 | if (QueryFullProcessImageName(p.Handle, 0, pathBuilder, ref pathLength)) { |
| 121 | string exeName = Path.GetFullPath(pathBuilder.ToString()); |
| 122 | Log.LogMessage("Found running process: " + exeName, MessageImportance.Low); |
| 123 | if (fullPath.Equals(exeName, StringComparison.OrdinalIgnoreCase)) { |
| 124 | Log.LogMessage("Terminating " + exeName, MessageImportance.High); |
| 125 | p.Kill(); |
| 126 | } |
| 127 | } |
| 128 | } catch { |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 129 | } |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 130 | } |
Jeremy Kloth | fa53294 | 2018-10-23 05:41:48 -0600 | [diff] [blame] | 131 | return true; |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 132 | } |
| 133 | ]]> |
| 134 | </Code> |
| 135 | </Task> |
| 136 | </UsingTask> |
Steve Dower | 21a92f8 | 2019-06-14 08:29:20 -0700 | [diff] [blame] | 137 | |
Steve Dower | f4f1080 | 2014-12-12 13:45:25 -0800 | [diff] [blame] | 138 | <Target Name="KillPython" BeforeTargets="PrepareForBuild" Condition="'$(KillPython)' == 'true'"> |
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 139 | <Message Text="Killing any running python$(PyDebugExt)$(PyTestExt).exe instances..." Importance="high" /> |
| 140 | <KillPython FileName="$(OutDir)python$(PyDebugExt)$(PyTestExt).exe" /> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 141 | </Target> |
Steve Dower | 21a92f8 | 2019-06-14 08:29:20 -0700 | [diff] [blame] | 142 | |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 143 | <!-- |
| 144 | A default target to handle msbuild pcbuild.proj /t:CleanAll. |
Steve Dower | 21a92f8 | 2019-06-14 08:29:20 -0700 | [diff] [blame] | 145 | |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 146 | Some externals projects don't respond to /t:Clean, so we invoke |
| 147 | CleanAll on them when we really want to clean up. |
| 148 | --> |
| 149 | <Target Name="CleanAll" DependsOnTargets="Clean"> |
| 150 | <MSBuild Projects="@(ProjectReference->'%(FullPath)')" |
| 151 | Properties="Configuration=$(Configuration);Platform=$(Platform)" |
| 152 | BuildInParallel="true" |
| 153 | StopOnFirstFailure="false" |
| 154 | Condition="Exists(%(FullPath))" |
| 155 | Targets="CleanAll" /> |
| 156 | </Target> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 157 | |
Steve Dower | 5fcd5e6 | 2017-09-06 10:01:38 -0700 | [diff] [blame] | 158 | <Target Name="CopyPGCFiles" BeforeTargets="PrepareForBuild" Condition="$(Configuration) == 'PGUpdate'"> |
| 159 | <ItemGroup> |
| 160 | <_PGCFiles Include="$(OutDir)instrumented\$(TargetName)!*.pgc" /> |
| 161 | <_PGDFile Include="$(OutDir)instrumented\$(TargetName).pgd" /> |
| 162 | <_CopyFiles Include="@(_PGCFiles);@(_PGDFile)" Condition="Exists(%(FullPath))" /> |
| 163 | </ItemGroup> |
| 164 | <Delete Files="@(_CopyFiles->'$(OutDir)%(Filename)%(Extension)')" /> |
| 165 | <Error Text="PGO run did not succeed (no $(TargetName)!*.pgc files) and there is no data to merge" |
| 166 | Condition="$(RequirePGCFiles) == 'true' and @(_PGCFiles) == ''" /> |
| 167 | <Copy SourceFiles="@(_CopyFiles)" |
| 168 | DestinationFolder="$(OutDir)" |
| 169 | UseHardLinksIfPossible="true" |
| 170 | OverwriteReadOnlyFiles="true" /> |
| 171 | </Target> |
| 172 | |
Steve Dower | 425ec15 | 2016-10-09 20:18:52 -0700 | [diff] [blame] | 173 | <PropertyGroup> |
Steve Dower | 5fcd5e6 | 2017-09-06 10:01:38 -0700 | [diff] [blame] | 174 | <SdkBinPath Condition="'$(SdkBinPath)' == '' or !Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot10)\bin\$(DefaultWindowsSDKVersion)\x86</SdkBinPath> |
| 175 | <SdkBinPath Condition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot10)\bin\x86</SdkBinPath> |
Steve Dower | 425ec15 | 2016-10-09 20:18:52 -0700 | [diff] [blame] | 176 | <SdkBinPath Condition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86</SdkBinPath> |
| 177 | <SdkBinPath Condition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86</SdkBinPath> |
| 178 | <SdkBinPath Condition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\</SdkBinPath> |
Steve Dower | db6434c | 2020-11-03 22:31:49 +0000 | [diff] [blame] | 179 | <_SignCommand Condition="Exists($(SdkBinPath)) and '$(SigningCertificate)' != '' and $(SupportSigning)">"$(SdkBinPath)\signtool.exe" sign /a /n "$(SigningCertificate)" /fd sha256 /tr http://timestamp.digicert.com/ /td sha256 /d "Python $(PythonVersion)"</_SignCommand> |
| 180 | <_SignCommand Condition="Exists($(SdkBinPath)) and '$(SigningCertificateSha1)' != '' and $(SupportSigning)">"$(SdkBinPath)\signtool.exe" sign /a /sha1 "$(SigningCertificateSha1)" /fd sha256 /tr http://timestamp.digicert.com/ /td sha256 /d "Python $(PythonVersion)"</_SignCommand> |
Steve Dower | 425ec15 | 2016-10-09 20:18:52 -0700 | [diff] [blame] | 181 | <_MakeCatCommand Condition="Exists($(SdkBinPath))">"$(SdkBinPath)\makecat.exe"</_MakeCatCommand> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 182 | </PropertyGroup> |
Steve Dower | d3bbc52 | 2018-12-21 13:48:18 -0800 | [diff] [blame] | 183 | |
| 184 | <Target Name="_SignBuild" AfterTargets="AfterBuild" Condition="'$(_SignCommand)' != '' and $(SupportSigning)"> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 185 | <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" /> |
| 186 | <Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" /> |
| 187 | </Target> |
Steve Dower | 2dd4174 | 2020-03-11 11:18:12 +0000 | [diff] [blame] | 188 | |
| 189 | |
Steve Dower | 894adc1 | 2020-03-11 23:24:30 +0000 | [diff] [blame] | 190 | <Target Name="FindVCRedistDir"> |
| 191 | <!-- Hard coded path for VS 2015 --> |
Steve Dower | 2dd4174 | 2020-03-11 11:18:12 +0000 | [diff] [blame] | 192 | <PropertyGroup Condition="$(PlatformToolset) == 'v140'"> |
| 193 | <VCRedistDir>$(VCInstallDir)\redist\</VCRedistDir> |
Steve Dower | 894adc1 | 2020-03-11 23:24:30 +0000 | [diff] [blame] | 194 | </PropertyGroup> |
| 195 | |
| 196 | <!-- Search for version number in some broken Build Tools installs --> |
| 197 | <ItemGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''"> |
| 198 | <_RedistFiles Include="$(VCInstallDir)\Redist\MSVC\*\*.*" /> |
| 199 | </ItemGroup> |
| 200 | <PropertyGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''"> |
| 201 | <_RedistDir>%(_RedistFiles.Directory)</_RedistDir> |
| 202 | <VCToolsRedistVersion>$([System.IO.Path]::GetFileName($(_RedistDir.Trim(`\`))))</VCToolsRedistVersion> |
| 203 | </PropertyGroup> |
| 204 | |
| 205 | <!-- Use correct path for VS 2017 and later --> |
| 206 | <PropertyGroup Condition="$(VCRedistDir) == ''"> |
| 207 | <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir> |
| 208 | </PropertyGroup> |
| 209 | |
| 210 | <PropertyGroup> |
Steve Dower | 2dd4174 | 2020-03-11 11:18:12 +0000 | [diff] [blame] | 211 | <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> |
| 212 | <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> |
| 213 | </PropertyGroup> |
| 214 | |
Steve Dower | 894adc1 | 2020-03-11 23:24:30 +0000 | [diff] [blame] | 215 | <Message Text="VC Redist Directory: $(VCRedistDir)" /> |
| 216 | <Message Text="VC Redist Version: $(VCToolsRedistVersion)" /> |
| 217 | </Target> |
| 218 | |
| 219 | <Target Name="FindVCRuntime" Returns="VCRuntimeDLL" DependsOnTargets="FindVCRedistDir"> |
Steve Dower | 2dd4174 | 2020-03-11 11:18:12 +0000 | [diff] [blame] | 220 | <ItemGroup Condition="$(VCInstallDir) != ''"> |
| 221 | <VCRuntimeDLL Include="$(VCRedistDir)\Microsoft.VC*.CRT\vcruntime*.dll" /> |
| 222 | </ItemGroup> |
| 223 | |
Steve Dower | 894adc1 | 2020-03-11 23:24:30 +0000 | [diff] [blame] | 224 | <Warning Text="vcruntime*.dll not found under $(VCRedistDir)." Condition="@(VCRuntimeDLL) == ''" /> |
| 225 | <Message Text="VC Runtime DLL(s):%0A- @(VCRuntimeDLL,'%0A- ')" /> |
Steve Dower | 2dd4174 | 2020-03-11 11:18:12 +0000 | [diff] [blame] | 226 | </Target> |
Victor Stinner | 27e2d1f | 2018-11-01 00:52:28 +0100 | [diff] [blame] | 227 | </Project> |