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="!HasTrailingSlash($(OutDir))">$(OutDir)\</OutDir> |
Steve Dower | 6fd76bc | 2016-07-16 16:13:19 -0700 | [diff] [blame^] | 8 | <Py_IntDir Condition="'$(PyIntDir)' == ''">$(SolutionDir)obj\</Py_IntDir> |
Steve Dower | de9fb28 | 2015-07-27 14:56:58 -0700 | [diff] [blame] | 9 | <IntDir>$(Py_IntDir)\$(ArchName)_$(Configuration)\$(ProjectName)\</IntDir> |
| 10 | <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] | 11 | <TargetName Condition="'$(TargetName)' == ''">$(ProjectName)</TargetName> |
| 12 | <TargetName>$(TargetName)$(PyDebugExt)</TargetName> |
| 13 | <GenerateManifest>false</GenerateManifest> |
| 14 | <EmbedManifest>false</EmbedManifest> |
| 15 | <SupportPGO Condition="'$(SupportPGO)' == ''">true</SupportPGO> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 16 | <SupportSigning Condition="'$(SupportSigning)' == ''">true</SupportSigning> |
| 17 | <SupportSigning Condition="'$(Configuration)' == 'Debug'">false</SupportSigning> |
| 18 | <SupportSigning Condition="'$(ConfigurationType)' == 'StaticLibrary'">false</SupportSigning> |
Zachary Ware | 6373ba5 | 2014-03-17 15:57:38 -0500 | [diff] [blame] | 19 | </PropertyGroup> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 20 | |
| 21 | <PropertyGroup> |
| 22 | <_DebugPreprocessorDefinition>NDEBUG;</_DebugPreprocessorDefinition> |
| 23 | <_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG;</_DebugPreprocessorDefinition> |
| 24 | <_PlatformPreprocessorDefinition>_WIN32;</_PlatformPreprocessorDefinition> |
| 25 | <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64;</_PlatformPreprocessorDefinition> |
| 26 | <_PydPreprocessorDefinition Condition="$(TargetExt) == '.pyd'">Py_BUILD_CORE_MODULE;</_PydPreprocessorDefinition> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 27 | </PropertyGroup> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 28 | <ItemDefinitionGroup> |
| 29 | <ClCompile> |
Steve Dower | 6fd76bc | 2016-07-16 16:13:19 -0700 | [diff] [blame^] | 30 | <AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 31 | <PreprocessorDefinitions>WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 32 | |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 33 | <Optimization>MaxSpeed</Optimization> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 34 | <IntrinsicFunctions>true</IntrinsicFunctions> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 35 | <StringPooling>true</StringPooling> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 36 | <ExceptionHandling></ExceptionHandling> |
Steve Dower | fcbe1df | 2015-09-08 21:39:01 -0700 | [diff] [blame] | 37 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 38 | <FunctionLevelLinking>true</FunctionLevelLinking> |
| 39 | <WarningLevel>Level3</WarningLevel> |
| 40 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> |
| 41 | <CompileAs>Default</CompileAs> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 42 | <SuppressStartupBanner>true</SuppressStartupBanner> |
| 43 | <WholeProgramOptimization>true</WholeProgramOptimization> |
Steve Dower | 5700ae8 | 2015-10-11 15:15:52 -0700 | [diff] [blame] | 44 | <EnableEnhancedInstructionSet Condition="'$(Platform)'=='Win32'">NoExtensions</EnableEnhancedInstructionSet> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 45 | </ClCompile> |
| 46 | <ClCompile Condition="$(Configuration) == 'Debug'"> |
| 47 | <Optimization>Disabled</Optimization> |
| 48 | <WholeProgramOptimization>false</WholeProgramOptimization> |
Steve Dower | fcbe1df | 2015-09-08 21:39:01 -0700 | [diff] [blame] | 49 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 50 | </ClCompile> |
Zachary Ware | 4c5ad94 | 2016-01-29 19:08:55 -0600 | [diff] [blame] | 51 | <ClCompile Condition="$(ICCBuild) == 'true'"> |
| 52 | <FloatingPointModel>Strict</FloatingPointModel> |
| 53 | </ClCompile> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 54 | <Link> |
| 55 | <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
| 56 | <GenerateDebugInformation>true</GenerateDebugInformation> |
| 57 | <ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile> |
| 58 | <SubSystem>Windows</SubSystem> |
Christian Heimes | f3bf35e | 2013-11-20 17:43:23 +0100 | [diff] [blame] | 59 | <RandomizedBaseAddress>true</RandomizedBaseAddress> |
| 60 | <DataExecutionPrevention>true</DataExecutionPrevention> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 61 | <SuppressStartupBanner>true</SuppressStartupBanner> |
Steve Dower | fcbe1df | 2015-09-08 21:39:01 -0700 | [diff] [blame] | 62 | <IgnoreSpecificDefaultLibraries>LIBC;%(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 | b066058 | 2016-04-06 12:35:24 -0700 | [diff] [blame] | 76 | <AdditionalIncludeDirectories>$(PySourcePath)PC;$(PySourcePath)Include;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 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> |
Steve Dower | 6fd76bc | 2016-07-16 16:13:19 -0700 | [diff] [blame^] | 86 | <TypeLibraryName>$(OutDir)%(Filename).tlb</TypeLibraryName> |
| 87 | <HeaderFileName>$(IntDir)%(Filename)_h.h</HeaderFileName> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 88 | </Midl> |
Brian Curtin | 401f9f3 | 2012-05-13 11:19:23 -0500 | [diff] [blame] | 89 | </ItemDefinitionGroup> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 90 | |
| 91 | <Target Name="GeneratePythonNtRcH" |
Steve Dower | b066058 | 2016-04-06 12:35:24 -0700 | [diff] [blame] | 92 | BeforeTargets="ClCompile" |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 93 | Inputs="$(PySourcePath)Include\patchlevel.h" |
Steve Dower | b066058 | 2016-04-06 12:35:24 -0700 | [diff] [blame] | 94 | Outputs="$(IntDir)pythonnt_rc.h"> |
| 95 | <WriteLinesToFile File="$(IntDir)pythonnt_rc.h" Overwrite="true" Encoding="ascii" |
| 96 | Lines='/* This file created by pyproject.props /t:GeneratePythonNtRcH */ |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 97 | #define FIELD3 $(Field3Value) |
Steve Dower | 2587952 | 2015-01-15 09:10:16 -0800 | [diff] [blame] | 98 | #define MS_DLL_ID "$(SysWinVer)" |
Steve Dower | b066058 | 2016-04-06 12:35:24 -0700 | [diff] [blame] | 99 | #define PYTHON_DLL_NAME "$(TargetName)$(TargetExt)" |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 100 | ' /> |
| 101 | <ItemGroup> |
Steve Dower | b066058 | 2016-04-06 12:35:24 -0700 | [diff] [blame] | 102 | <FileWrites Include="$(IntDir)pythonnt_rc.h" /> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 103 | </ItemGroup> |
| 104 | </Target> |
| 105 | |
| 106 | <UsingTask TaskName="KillPython" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> |
| 107 | <ParameterGroup> |
| 108 | <FileName Required="true" /> |
| 109 | </ParameterGroup> |
| 110 | <Task> |
| 111 | <Code Type="Fragment" Language="cs"> |
| 112 | <![CDATA[ |
| 113 | string fullPath = System.IO.Path.GetFullPath(FileName); |
| 114 | Log.LogMessage("Looking for " + fullPath, MessageImportance.Normal); |
| 115 | foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses()) { |
| 116 | try { |
| 117 | Log.LogMessage("Found running process: " + p.MainModule.FileName, MessageImportance.Low); |
| 118 | if (fullPath.Equals(System.IO.Path.GetFullPath(p.MainModule.FileName), StringComparison.OrdinalIgnoreCase)) { |
| 119 | Log.LogMessage("Terminating " + p.MainModule.FileName, MessageImportance.High); |
| 120 | p.Kill(); |
| 121 | } |
| 122 | } catch { |
| 123 | } |
| 124 | } |
| 125 | ]]> |
| 126 | </Code> |
| 127 | </Task> |
| 128 | </UsingTask> |
Steve Dower | 10e6585 | 2014-12-12 12:18:11 -0800 | [diff] [blame] | 129 | |
Steve Dower | f4f1080 | 2014-12-12 13:45:25 -0800 | [diff] [blame] | 130 | <Target Name="KillPython" BeforeTargets="PrepareForBuild" Condition="'$(KillPython)' == 'true'"> |
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 131 | <Message Text="Killing any running python$(PyDebugExt)$(PyTestExt).exe instances..." Importance="high" /> |
| 132 | <KillPython FileName="$(OutDir)python$(PyDebugExt)$(PyTestExt).exe" /> |
Steve Dower | 65e4cb1 | 2014-11-22 12:54:57 -0800 | [diff] [blame] | 133 | </Target> |
| 134 | |
| 135 | <!-- |
| 136 | A default target to handle msbuild pcbuild.proj /t:CleanAll. |
| 137 | |
| 138 | Some externals projects don't respond to /t:Clean, so we invoke |
| 139 | CleanAll on them when we really want to clean up. |
| 140 | --> |
| 141 | <Target Name="CleanAll" DependsOnTargets="Clean"> |
| 142 | <MSBuild Projects="@(ProjectReference->'%(FullPath)')" |
| 143 | Properties="Configuration=$(Configuration);Platform=$(Platform)" |
| 144 | BuildInParallel="true" |
| 145 | StopOnFirstFailure="false" |
| 146 | Condition="Exists(%(FullPath))" |
| 147 | Targets="CleanAll" /> |
| 148 | </Target> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 149 | |
| 150 | <PropertyGroup Condition="'$(SigningCertificate)' != '' and $(SupportSigning)"> |
| 151 | <SignToolPath Condition="'$(SignToolPath)' == '' or !Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86\signtool.exe</SignToolPath> |
| 152 | <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86\signtool.exe</SignToolPath> |
| 153 | <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\signtool.exe</SignToolPath> |
Steve Dower | 84d9fe3 | 2016-02-08 09:24:46 -0800 | [diff] [blame] | 154 | <_SignCommand Condition="Exists($(SignToolPath))">"$(SignToolPath)" sign /q /n "$(SigningCertificate)" /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 155 | </PropertyGroup> |
| 156 | |
| 157 | <Target Name="_SignBuild" AfterTargets="AfterBuild" Condition="'$(SigningCertificate)' != '' and $(SupportSigning)"> |
| 158 | <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" /> |
| 159 | <Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" /> |
| 160 | </Target> |
Zachary Ware | a191b91 | 2014-03-21 22:58:19 -0500 | [diff] [blame] | 161 | </Project> |