blob: d2a9cae5d917f8d74508a9d19778f02732f0ca8c [file] [log] [blame]
Brian Curtin401f9f32012-05-13 11:19:23 -05001<?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 Dower65e4cb12014-11-22 12:54:57 -08004 <ProjectConfiguration Include="Debug|Win32">
5 <Configuration>Debug</Configuration>
6 <Platform>Win32</Platform>
7 </ProjectConfiguration>
8 <ProjectConfiguration Include="Debug|x64">
9 <Configuration>Debug</Configuration>
10 <Platform>x64</Platform>
11 </ProjectConfiguration>
Brian Curtin401f9f32012-05-13 11:19:23 -050012 <ProjectConfiguration Include="PGInstrument|Win32">
13 <Configuration>PGInstrument</Configuration>
14 <Platform>Win32</Platform>
15 </ProjectConfiguration>
16 <ProjectConfiguration Include="PGInstrument|x64">
17 <Configuration>PGInstrument</Configuration>
18 <Platform>x64</Platform>
19 </ProjectConfiguration>
20 <ProjectConfiguration Include="PGUpdate|Win32">
21 <Configuration>PGUpdate</Configuration>
22 <Platform>Win32</Platform>
23 </ProjectConfiguration>
24 <ProjectConfiguration Include="PGUpdate|x64">
25 <Configuration>PGUpdate</Configuration>
26 <Platform>x64</Platform>
27 </ProjectConfiguration>
28 <ProjectConfiguration Include="Release|Win32">
29 <Configuration>Release</Configuration>
30 <Platform>Win32</Platform>
31 </ProjectConfiguration>
32 <ProjectConfiguration Include="Release|x64">
33 <Configuration>Release</Configuration>
34 <Platform>x64</Platform>
35 </ProjectConfiguration>
36 </ItemGroup>
37 <PropertyGroup Label="Globals">
38 <ProjectGuid>{885D4898-D08D-4091-9C40-C700CFE3FC5A}</ProjectGuid>
39 <RootNamespace>python3dll</RootNamespace>
40 <Keyword>Win32Proj</Keyword>
Steve Dower65e4cb12014-11-22 12:54:57 -080041 <TargetName>python3</TargetName>
Steve Dower65e4cb12014-11-22 12:54:57 -080042 <SupportPGO>false</SupportPGO>
Brian Curtin401f9f32012-05-13 11:19:23 -050043 </PropertyGroup>
Steve Dower65e4cb12014-11-22 12:54:57 -080044 <Import Project="python.props" />
Brian Curtin401f9f32012-05-13 11:19:23 -050045 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Steve Dower65e4cb12014-11-22 12:54:57 -080046 <PropertyGroup Label="Configuration">
47 <ConfigurationType>DynamicLibrary</ConfigurationType>
Brian Curtin401f9f32012-05-13 11:19:23 -050048 </PropertyGroup>
49 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
50 <ImportGroup Label="ExtensionSettings">
51 </ImportGroup>
Steve Dower65e4cb12014-11-22 12:54:57 -080052 <ImportGroup Label="PropertySheets">
Brian Curtin401f9f32012-05-13 11:19:23 -050053 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
54 <Import Project="pyproject.props" />
Brian Curtin401f9f32012-05-13 11:19:23 -050055 </ImportGroup>
56 <PropertyGroup Label="UserMacros" />
57 <PropertyGroup>
58 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
Steve Dower65e4cb12014-11-22 12:54:57 -080059 <_Machine>X86</_Machine>
60 <_Machine Condition="$(Platform) == 'x64'">X64</_Machine>
Steve Dower945863a2016-07-13 19:58:21 -070061 <ExtensionsToDeleteOnClean>$(ExtensionsToDeleteOnClean);$(IntDir)python3_d.def;$(IntDir)python3stub.def</ExtensionsToDeleteOnClean>
Brian Curtin401f9f32012-05-13 11:19:23 -050062 </PropertyGroup>
63 <ItemDefinitionGroup>
Steve Dower65e4cb12014-11-22 12:54:57 -080064 <ClCompile>
65 <BufferSecurityCheck>false</BufferSecurityCheck>
66 </ClCompile>
67 <Link>
68 <AdditionalDependencies>$(OutDir)$(TargetName)stub.lib</AdditionalDependencies>
Steve Dowere5a6c4e2015-01-31 11:17:07 -080069 <ModuleDefinitionFile Condition="$(Configuration) != 'Debug'">$(PySourcePath)PC\python3.def</ModuleDefinitionFile>
70 <ModuleDefinitionFile Condition="$(Configuration) == 'Debug'">$(IntDir)python3_d.def</ModuleDefinitionFile>
Steve Dower65e4cb12014-11-22 12:54:57 -080071 <EntryPointSymbol>DllMain</EntryPointSymbol>
72 </Link>
73 <PreLinkEvent>
74 <Command>lib /nologo /def:"$(IntDir)python3stub.def" /out:"$(OutDir)$(TargetName)stub.lib" /MACHINE:$(_Machine)</Command>
75 <Message>Rebuilding $(TargetName)stub.lib</Message>
76 <Outputs>$(OutDir)$(TargetName)stub.lib</Outputs>
77 </PreLinkEvent>
Brian Curtin401f9f32012-05-13 11:19:23 -050078 </ItemDefinitionGroup>
79 <ItemGroup>
80 <None Include="..\PC\python3.def" />
81 </ItemGroup>
82 <ItemGroup>
83 <ClCompile Include="..\PC\python3dll.c" />
84 </ItemGroup>
85 <ItemGroup>
86 <ResourceCompile Include="..\PC\python_nt.rc" />
87 </ItemGroup>
88 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
89 <ImportGroup Label="ExtensionTargets">
90 </ImportGroup>
Steve Dowere5a6c4e2015-01-31 11:17:07 -080091
Steve Dowere97ba4c2018-05-28 12:32:05 -070092 <Target Name="BuildPython3_dDef" BeforeTargets="BuildStubDef" Condition="$(Configuration) == 'Debug'">
Steve Dowere5a6c4e2015-01-31 11:17:07 -080093 <ItemGroup>
94 <_DefLines Remove="@(_DefLines)" />
95 <_Lines Remove="@(_Lines)" />
Steve Dowere97ba4c2018-05-28 12:32:05 -070096 <_OriginalLines Remove="@(_OriginalLines)" />
Steve Dowere5a6c4e2015-01-31 11:17:07 -080097 </ItemGroup>
Steve Dower65e4cb12014-11-22 12:54:57 -080098 <ReadLinesFromFile File="..\PC\python3.def">
Steve Dowere5a6c4e2015-01-31 11:17:07 -080099 <Output TaskParameter="Lines" ItemName="_DefLines" />
100 </ReadLinesFromFile>
Steve Dowere97ba4c2018-05-28 12:32:05 -0700101 <ReadLinesFromFile File="$(IntDir)python3_d.def" Condition="Exists('$(IntDir)python3_d.def')">
102 <Output TaskParameter="Lines" ItemName="_OriginalLines" />
103 </ReadLinesFromFile>
Steve Dowere5a6c4e2015-01-31 11:17:07 -0800104 <PropertyGroup>
105 <_Pattern1>(=python$(MajorVersionNumber)$(MinorVersionNumber))\.</_Pattern1>
106 <_Sub1>$1_d.</_Sub1>
107 <_Pattern2>"python3"</_Pattern2>
108 <_Sub2>"python3_d"</_Sub2>
109 </PropertyGroup>
110 <ItemGroup>
111 <_Lines Include="@(_DefLines)">
112 <New>$([System.Text.RegularExpressions.Regex]::Replace($([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern1)`, `$(_Sub1)`)), `$(_Pattern2)`, `$(_Sub2)`))</New>
113 </_Lines>
114 </ItemGroup>
115 <MakeDir Directories="$(IntDir)" />
Steve Dowere97ba4c2018-05-28 12:32:05 -0700116 <Message Text="Updating python3_d.def" Condition="@(_Lines->'%(New)') != @(_OriginalLines)" Importance="high" />
117 <WriteLinesToFile File="$(IntDir)python3_d.def" Lines="@(_Lines->'%(New)')" Overwrite="true"
118 Condition="@(_Lines->'%(New)') != @(_OriginalLines)" />
Steve Dowere5a6c4e2015-01-31 11:17:07 -0800119 </Target>
120
Steve Dowere97ba4c2018-05-28 12:32:05 -0700121 <Target Name="BuildStubDef" BeforeTargets="PreLinkEvent">
Steve Dowere5a6c4e2015-01-31 11:17:07 -0800122 <ItemGroup>
123 <_DefLines Remove="@(_DefLines)" />
124 <_Lines Remove="@(_Lines)" />
Steve Dowere97ba4c2018-05-28 12:32:05 -0700125 <_OriginalLines Remove="@(_OriginalLines)" />
Steve Dowere5a6c4e2015-01-31 11:17:07 -0800126 </ItemGroup>
127 <ReadLinesFromFile File="..\PC\python3.def">
128 <Output TaskParameter="Lines" ItemName="_DefLines" />
Steve Dower65e4cb12014-11-22 12:54:57 -0800129 </ReadLinesFromFile>
Steve Dowere97ba4c2018-05-28 12:32:05 -0700130 <ReadLinesFromFile File="$(IntDir)python3stub.def" Condition="Exists('$(IntDir)python3stub.def')">
131 <Output TaskParameter="Lines" ItemName="_OriginalLines" />
132 </ReadLinesFromFile>
Steve Dower65e4cb12014-11-22 12:54:57 -0800133 <PropertyGroup>
134 <_Pattern>^[\w.]+=.+?\.([^ ]+).*$</_Pattern>
135 <_Sub>$1</_Sub>
136 </PropertyGroup>
137 <ItemGroup>
138 <_Lines Include="EXPORTS" />
Steve Dowere5a6c4e2015-01-31 11:17:07 -0800139 <_Symbols Include="@(_DefLines)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch(`%(Identity)`, `$(_Pattern)`))">
Steve Dower65e4cb12014-11-22 12:54:57 -0800140 <Symbol>$([System.Text.RegularExpressions.Regex]::Replace(`%(Identity)`, `$(_Pattern)`, `$(_Sub)`))</Symbol>
141 </_Symbols>
142 <_Lines Include="@(_Symbols->'%(Symbol)')" />
143 </ItemGroup>
144 <MakeDir Directories="$(IntDir)" />
Steve Dowerf9b364f2018-05-28 14:05:05 -0700145 <Message Text="Updating python3stub.def" Condition="@(_Lines) != @(_OriginalLines)" Importance="high" />
Steve Dowere97ba4c2018-05-28 12:32:05 -0700146 <WriteLinesToFile File="$(IntDir)python3stub.def" Lines="@(_Lines)" Overwrite="true"
Steve Dowerf9b364f2018-05-28 14:05:05 -0700147 Condition="@(_Lines) != @(_OriginalLines)" />
Steve Dower65e4cb12014-11-22 12:54:57 -0800148 </Target>
Brian Curtin401f9f32012-05-13 11:19:23 -0500149</Project>