summaryrefslogtreecommitdiffstats
path: root/PCbuild/pyproject.props
diff options
context:
space:
mode:
Diffstat (limited to 'PCbuild/pyproject.props')
-rw-r--r--PCbuild/pyproject.props206
1 files changed, 129 insertions, 77 deletions
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index 7e6c7dd..1afbfe1 100644
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -1,48 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup Condition="'$(Platform)'=='Win32'">
+ <PropertyGroup Label="Globals">
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir>$(SolutionDir)</OutDir>
- <IntDir>$(SolutionDir)$(PlatformName)-temp-$(Configuration)\$(ProjectName)\</IntDir>
- <LinkIncremental>false</LinkIncremental>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Platform)'=='x64'">
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <_PropertySheetDisplayName>amd64</_PropertySheetDisplayName>
- <OutDir>$(SolutionDir)amd64\</OutDir>
- <IntDir>$(SolutionDir)$(PlatformName)-temp-$(Configuration)\$(ProjectName)\</IntDir>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <OutDir>$(BuildPath)</OutDir>
+ <IntDir>$(SolutionDir)obj\$(ArchName)_$(Configuration)\$(ProjectName)\</IntDir>
+ <IntDir Condition="$(Configuration) == 'PGInstrument' or $(Configuration) == 'PGUpdate'">$(SolutionDir)obj\$(ArchName)\$(ProjectName)\</IntDir>
+ <TargetName Condition="'$(TargetName)' == ''">$(ProjectName)</TargetName>
+ <TargetName>$(TargetName)$(PyDebugExt)</TargetName>
+ <GenerateManifest>false</GenerateManifest>
+ <EmbedManifest>false</EmbedManifest>
+ <SupportPGO Condition="'$(SupportPGO)' == ''">true</SupportPGO>
+ <SupportSigning Condition="'$(SupportSigning)' == ''">true</SupportSigning>
+ <SupportSigning Condition="'$(Configuration)' == 'Debug'">false</SupportSigning>
+ <SupportSigning Condition="'$(ConfigurationType)' == 'StaticLibrary'">false</SupportSigning>
</PropertyGroup>
- <PropertyGroup Label="UserMacros">
- <PyDllName>python34$(PyDebugExt)</PyDllName>
- <PythonExe>$(OutDir)python$(PyDebugExt).exe</PythonExe>
- <KillPythonExe>$(OutDir)kill_python$(PyDebugExt).exe</KillPythonExe>
- <externalsDir>..\externals</externalsDir>
- <sqlite3Dir>$(externalsDir)\sqlite-3.8.3.1</sqlite3Dir>
- <bz2Dir>$(externalsDir)\bzip2-1.0.6</bz2Dir>
- <lzmaDir>$(externalsDir)\xz-5.0.5</lzmaDir>
- <opensslDir>$(externalsDir)\openssl-1.0.2a</opensslDir>
- <tcltkDir>$(externalsDir)\tcltk</tcltkDir>
- <tcltk64Dir>$(externalsDir)\tcltk64</tcltk64Dir>
- <tcltkLib>$(tcltkDir)\lib\tcl86t.lib;$(tcltkDir)\lib\tk86t.lib</tcltkLib>
- <tcltkLibDebug>$(tcltkDir)\lib\tcl86tg.lib;$(tcltkDir)\lib\tk86tg.lib</tcltkLibDebug>
- <tcltk64Lib>$(tcltk64Dir)\lib\tcl86t.lib;$(tcltk64Dir)\lib\tk86t.lib</tcltk64Lib>
- <tcltk64LibDebug>$(tcltk64Dir)\lib\tcl86tg.lib;$(tcltk64Dir)\lib\tk86tg.lib</tcltk64LibDebug>
+
+ <PropertyGroup>
+ <_DebugPreprocessorDefinition>NDEBUG;</_DebugPreprocessorDefinition>
+ <_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG;</_DebugPreprocessorDefinition>
+ <_PlatformPreprocessorDefinition>_WIN32;</_PlatformPreprocessorDefinition>
+ <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64;</_PlatformPreprocessorDefinition>
+ <_PydPreprocessorDefinition Condition="$(TargetExt) == '.pyd'">Py_BUILD_CORE_MODULE;</_PydPreprocessorDefinition>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
+ <AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)PC;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions>
+
<Optimization>MaxSpeed</Optimization>
- <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>..\Include; ..\PC;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <ExceptionHandling></ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </ClCompile>
+ <ClCompile Condition="$(Configuration) == 'Debug'">
+ <Optimization>Disabled</Optimization>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -51,54 +52,105 @@
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<TargetMachine>MachineX86</TargetMachine>
+ <TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine>
+ <ProfileGuidedDatabase Condition="$(SupportPGO)">$(OutDir)$(TargetName).pgd</ProfileGuidedDatabase>
+ <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">PGInstrument</LinkTimeCodeGeneration>
+ <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration>
</Link>
+ <Lib>
+ <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration>
+ <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">true</LinkTimeCodeGeneration>
+ <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">true</LinkTimeCodeGeneration>
+ </Lib>
<ResourceCompile>
- <AdditionalIncludeDirectories>..\PC;..\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(PySourcePath)PC;$(PySourcePath)Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>$(_DebugPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
</ResourceCompile>
+ <Midl>
+ <PreprocessorDefinitions>$(_DebugPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TargetEnvironment Condition="'$(Platform)' == 'x64'">X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)wininst.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
</ItemDefinitionGroup>
- <ItemGroup>
- <BuildMacro Include="PyDllName">
- <Value>$(PyDllName)</Value>
- </BuildMacro>
- <BuildMacro Include="PythonExe">
- <Value>$(PythonExe)</Value>
- </BuildMacro>
- <BuildMacro Include="KillPythonExe">
- <Value>$(KillPythonExe)</Value>
- </BuildMacro>
- <BuildMacro Include="externalsDir">
- <Value>$(externalsDir)</Value>
- </BuildMacro>
- <BuildMacro Include="sqlite3Dir">
- <Value>$(sqlite3Dir)</Value>
- </BuildMacro>
- <BuildMacro Include="bz2Dir">
- <Value>$(bz2Dir)</Value>
- </BuildMacro>
- <BuildMacro Include="lzmaDir">
- <Value>$(lzmaDir)</Value>
- </BuildMacro>
- <BuildMacro Include="opensslDir">
- <Value>$(opensslDir)</Value>
- </BuildMacro>
- <BuildMacro Include="tcltkDir">
- <Value>$(tcltkDir)</Value>
- </BuildMacro>
- <BuildMacro Include="tcltk64Dir">
- <Value>$(tcltk64Dir)</Value>
- </BuildMacro>
- <BuildMacro Include="tcltkLib">
- <Value>$(tcltkLib)</Value>
- </BuildMacro>
- <BuildMacro Include="tcltkLibDebug">
- <Value>$(tcltkLibDebug)</Value>
- </BuildMacro>
- <BuildMacro Include="tcltk64Lib">
- <Value>$(tcltk64Lib)</Value>
- </BuildMacro>
- <BuildMacro Include="tcltk64LibDebug">
- <Value>$(tcltk64LibDebug)</Value>
- </BuildMacro>
- </ItemGroup>
-</Project>
+
+ <Target Name="GeneratePythonNtRcH"
+ BeforeTargets="$(MakeVersionInfoBeforeTarget)"
+ Inputs="$(PySourcePath)Include\patchlevel.h"
+ Outputs="$(PySourcePath)PC\pythonnt_rc$(PyDebugExt).h">
+ <WriteLinesToFile File="$(PySourcePath)PC\pythonnt_rc$(PyDebugExt).h" Overwrite="true" Encoding="ascii"
+ Lines='/* This file created by python.props /t:GeneratePythonNtRcH */
+#define FIELD3 $(Field3Value)
+#define MS_DLL_ID "$(SysWinVer)"
+#define PYTHON_DLL_NAME "$(PyDllName).dll"
+' />
+ <ItemGroup>
+ <FileWrites Include="$(PySourcePath)PC\pythonnt_rc$(PyDebugExt).h" />
+ </ItemGroup>
+ </Target>
+
+ <UsingTask TaskName="KillPython" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+ <ParameterGroup>
+ <FileName Required="true" />
+ </ParameterGroup>
+ <Task>
+ <Code Type="Fragment" Language="cs">
+<![CDATA[
+string fullPath = System.IO.Path.GetFullPath(FileName);
+Log.LogMessage("Looking for " + fullPath, MessageImportance.Normal);
+foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses()) {
+ try {
+ Log.LogMessage("Found running process: " + p.MainModule.FileName, MessageImportance.Low);
+ if (fullPath.Equals(System.IO.Path.GetFullPath(p.MainModule.FileName), StringComparison.OrdinalIgnoreCase)) {
+ Log.LogMessage("Terminating " + p.MainModule.FileName, MessageImportance.High);
+ p.Kill();
+ }
+ } catch {
+ }
+}
+]]>
+ </Code>
+ </Task>
+ </UsingTask>
+
+ <Target Name="KillPython" BeforeTargets="PrepareForBuild" Condition="'$(KillPython)' == 'true'">
+ <Message Text="Killing any running python.exe instances..." Importance="high" />
+ <KillPython FileName="$(OutDir)python$(PyDebugExt).exe" />
+ </Target>
+
+ <!--
+ A default target to handle msbuild pcbuild.proj /t:CleanAll.
+
+ Some externals projects don't respond to /t:Clean, so we invoke
+ CleanAll on them when we really want to clean up.
+ -->
+ <Target Name="CleanAll" DependsOnTargets="Clean">
+ <MSBuild Projects="@(ProjectReference->'%(FullPath)')"
+ Properties="Configuration=$(Configuration);Platform=$(Platform)"
+ BuildInParallel="true"
+ StopOnFirstFailure="false"
+ Condition="Exists(%(FullPath))"
+ Targets="CleanAll" />
+ </Target>
+
+ <PropertyGroup Condition="'$(SigningCertificate)' != '' and $(SupportSigning)">
+ <SignToolPath Condition="'$(SignToolPath)' == '' or !Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86\signtool.exe</SignToolPath>
+ <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86\signtool.exe</SignToolPath>
+ <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\signtool.exe</SignToolPath>
+ <_SignCommand Condition="Exists($(SignToolPath))">"$(SignToolPath)" sign /q /n "$(SigningCertificate)" /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand>
+ </PropertyGroup>
+
+ <Target Name="_SignBuild" AfterTargets="AfterBuild" Condition="'$(SigningCertificate)' != '' and $(SupportSigning)">
+ <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
+ <Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" />
+ </Target>
+</Project> \ No newline at end of file