Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
Steve Dower | de9fb28 | 2015-07-27 14:56:58 -0700 | [diff] [blame] | 2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="Py_IntDir"> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 3 | <PropertyGroup Label="Globals"> |
Stefan Krah | 318c56c | 2012-06-24 19:04:35 +0200 | [diff] [blame] | 4 | <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 5 | <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> |
| 6 | <OutDir>$(BuildPath)</OutDir> |
Steve Dower | de9fb28 | 2015-07-27 14:56:58 -0700 | [diff] [blame] | 7 | <OutDir Condition="'$(Py_OutDir)' != ''">$(Py_OutDir)</OutDir> |
| 8 | <OutDir Condition="!HasTrailingSlash($(OutDir))">$(OutDir)\</OutDir> |
| 9 | <Py_IntDir Condition="'$(Py_IntDir)' == ''">$(SolutionDir)obj\</Py_IntDir> |
| 10 | <IntDir Condition="!HasTrailingSlash($(IntDir))">$(IntDir)\</IntDir> |
| 11 | <IntDir>$(Py_IntDir)\$(ArchName)_$(Configuration)\$(ProjectName)\</IntDir> |
| 12 | <IntDir Condition="$(Configuration) == 'PGInstrument' or $(Configuration) == 'PGUpdate'">$(Py_IntDir)\$(ArchName)_PGO\$(ProjectName)\</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> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 29 | </PropertyGroup> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 30 | <ItemDefinitionGroup> |
| 31 | <ClCompile> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 32 | <AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)PC;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| 33 | <PreprocessorDefinitions>WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 34 | |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 35 | <Optimization>MaxSpeed</Optimization> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 36 | <IntrinsicFunctions>true</IntrinsicFunctions> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 37 | <StringPooling>true</StringPooling> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 38 | <ExceptionHandling></ExceptionHandling> |
Steve Dower | 6d58f8d | 2015-06-19 10:49:04 -0700 | [diff] [blame] | 39 | <RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 40 | <FunctionLevelLinking>true</FunctionLevelLinking> |
| 41 | <WarningLevel>Level3</WarningLevel> |
| 42 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
| 43 | <CompileAs>Default</CompileAs> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 44 | <SuppressStartupBanner>true</SuppressStartupBanner> |
| 45 | <WholeProgramOptimization>true</WholeProgramOptimization> |
| 46 | </ClCompile> |
| 47 | <ClCompile Condition="$(Configuration) == 'Debug'"> |
| 48 | <Optimization>Disabled</Optimization> |
| 49 | <WholeProgramOptimization>false</WholeProgramOptimization> |
Steve Dower | 6d58f8d | 2015-06-19 10:49:04 -0700 | [diff] [blame] | 50 | <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 51 | </ClCompile> |
| 52 | <Link> |
| 53 | <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
| 54 | <GenerateDebugInformation>true</GenerateDebugInformation> |
| 55 | <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile> |
| 56 | <SubSystem>Windows</SubSystem> |
Christian Heimes | f3bf35e | 2013-11-20 17:43:23 +0100 | [diff] [blame] | 57 | <RandomizedBaseAddress>true</RandomizedBaseAddress> |
| 58 | <DataExecutionPrevention>true</DataExecutionPrevention> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 59 | <SuppressStartupBanner>true</SuppressStartupBanner> |
Steve Dower | 6d58f8d | 2015-06-19 10:49:04 -0700 | [diff] [blame] | 60 | <AdditionalDependencies Condition="$(Configuration) == 'Debug'">ucrtd.lib;%(AdditionalDependencies)</AdditionalDependencies> |
| 61 | <AdditionalDependencies Condition="$(Configuration) != 'Debug'">ucrt.lib;%(AdditionalDependencies)</AdditionalDependencies> |
| 62 | <IgnoreSpecificDefaultLibraries>LIBC;libucrt.lib;libucrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 63 | <TargetMachine>MachineX86</TargetMachine> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 64 | <TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine> |
| 65 | <ProfileGuidedDatabase Condition="$(SupportPGO)">$(OutDir)$(TargetName).pgd</ProfileGuidedDatabase> |
| 66 | <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration> |
| 67 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">PGInstrument</LinkTimeCodeGeneration> |
| 68 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 69 | </Link> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 70 | <Lib> |
| 71 | <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration> |
| 72 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">true</LinkTimeCodeGeneration> |
| 73 | <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">true</LinkTimeCodeGeneration> |
| 74 | </Lib> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 75 | <ResourceCompile> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 76 | <AdditionalIncludeDirectories>$(PySourcePath)PC;$(PySourcePath)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| 77 | <PreprocessorDefinitions>$(_DebugPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 78 | <Culture>0x0409</Culture> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 79 | </ResourceCompile> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 80 | <Midl> |
| 81 | <PreprocessorDefinitions>$(_DebugPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 82 | <MkTypLibCompatible>true</MkTypLibCompatible> |
| 83 | <SuppressStartupBanner>true</SuppressStartupBanner> |
| 84 | <TargetEnvironment>Win32</TargetEnvironment> |
| 85 | <TargetEnvironment Condition="'$(Platform)' == 'x64'">X64</TargetEnvironment> |
| 86 | <TypeLibraryName>$(OutDir)wininst.tlb</TypeLibraryName> |
| 87 | <HeaderFileName> |
| 88 | </HeaderFileName> |
| 89 | </Midl> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 90 | </ItemDefinitionGroup> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 91 | |
| 92 | <Target Name="GeneratePythonNtRcH" |
| 93 | BeforeTargets="$(MakeVersionInfoBeforeTarget)" |
| 94 | Inputs="$(PySourcePath)Include\patchlevel.h" |
| 95 | Outputs="$(PySourcePath)PC\pythonnt_rc$(PyDebugExt).h"> |
| 96 | <WriteLinesToFile File="$(PySourcePath)PC\pythonnt_rc$(PyDebugExt).h" Overwrite="true" Encoding="ascii" |
| 97 | Lines='/* This file created by python.props /t:GeneratePythonNtRcH */ |
| 98 | #define FIELD3 $(Field3Value) |
Steve Dower | 2587952 | 2015-01-15 09:10:16 -0800 | [diff] [blame] | 99 | #define MS_DLL_ID "$(SysWinVer)" |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 100 | #define PYTHON_DLL_NAME "$(PyDllName).dll" |
| 101 | ' /> |
| 102 | <ItemGroup> |
| 103 | <FileWrites Include="$(PySourcePath)PC\pythonnt_rc$(PyDebugExt).h" /> |
| 104 | </ItemGroup> |
| 105 | </Target> |
| 106 | |
| 107 | <UsingTask TaskName="KillPython" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> |
| 108 | <ParameterGroup> |
| 109 | <FileName Required="true" /> |
| 110 | </ParameterGroup> |
| 111 | <Task> |
| 112 | <Code Type="Fragment" Language="cs"> |
| 113 | <![CDATA[ |
| 114 | string fullPath = System.IO.Path.GetFullPath(FileName); |
| 115 | Log.LogMessage("Looking for " + fullPath, MessageImportance.Normal); |
| 116 | foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses()) { |
| 117 | try { |
| 118 | Log.LogMessage("Found running process: " + p.MainModule.FileName, MessageImportance.Low); |
| 119 | if (fullPath.Equals(System.IO.Path.GetFullPath(p.MainModule.FileName), StringComparison.OrdinalIgnoreCase)) { |
| 120 | Log.LogMessage("Terminating " + p.MainModule.FileName, MessageImportance.High); |
| 121 | p.Kill(); |
| 122 | } |
| 123 | } catch { |
| 124 | } |
| 125 | } |
| 126 | ]]> |
| 127 | </Code> |
| 128 | </Task> |
| 129 | </UsingTask> |
Steve Dower | 10e6585 | 2014-12-12 12:18:11 -0800 | [diff] [blame] | 130 | |
Steve Dower | f4f1080 | 2014-12-12 13:45:25 -0800 | [diff] [blame] | 131 | <Target Name="KillPython" BeforeTargets="PrepareForBuild" Condition="'$(KillPython)' == 'true'"> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 132 | <Message Text="Killing any running python.exe instances..." Importance="high" /> |
| 133 | <KillPython FileName="$(OutDir)python$(PyDebugExt).exe" /> |
| 134 | </Target> |
| 135 | |
| 136 | <!-- |
| 137 | A default target to handle msbuild pcbuild.proj /t:CleanAll. |
| 138 | |
| 139 | Some externals projects don't respond to /t:Clean, so we invoke |
| 140 | CleanAll on them when we really want to clean up. |
| 141 | --> |
| 142 | <Target Name="CleanAll" DependsOnTargets="Clean"> |
| 143 | <MSBuild Projects="@(ProjectReference->'%(FullPath)')" |
| 144 | Properties="Configuration=$(Configuration);Platform=$(Platform)" |
| 145 | BuildInParallel="true" |
| 146 | StopOnFirstFailure="false" |
| 147 | Condition="Exists(%(FullPath))" |
| 148 | Targets="CleanAll" /> |
| 149 | </Target> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 150 | |
| 151 | <PropertyGroup Condition="'$(SigningCertificate)' != '' and $(SupportSigning)"> |
| 152 | <SignToolPath Condition="'$(SignToolPath)' == '' or !Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86\signtool.exe</SignToolPath> |
| 153 | <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86\signtool.exe</SignToolPath> |
| 154 | <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\signtool.exe</SignToolPath> |
| 155 | <_SignCommand Condition="Exists($(SignToolPath))">"$(SignToolPath)" sign /q /n "$(SigningCertificate)" /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand> |
| 156 | </PropertyGroup> |
| 157 | |
| 158 | <Target Name="_SignBuild" AfterTargets="AfterBuild" Condition="'$(SigningCertificate)' != '' and $(SupportSigning)"> |
| 159 | <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" /> |
| 160 | <Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" /> |
| 161 | </Target> |
Zachary Ware | a191b91 | 2014-03-21 22:58:19 -0500 | [diff] [blame] | 162 | </Project> |