|
1 | 1 | <?xml version="1.0" encoding="utf-8"?>
|
2 | 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3 | 3 | <ImportGroup Label="PropertySheets">
|
4 |
| - <Import Project="env.props" /> |
| 4 | + <Import Project="paths.props" Condition="'$(PyPathsIncluded)' != 'True'"/> |
5 | 5 | </ImportGroup>
|
6 | 6 | <PropertyGroup Label="UserMacros" />
|
7 | 7 | <PropertyGroup>
|
8 | 8 | <OutDir>$(PyOutDir)</OutDir>
|
9 |
| - <IntDir>$(PyBuildDir)$(Configuration)$(Platform)\</IntDir> |
10 |
| - <PyIncDirs>$(PyBaseDir);$(PyBaseDir)windows;$(PyBaseDir)windows\msvc;$(PyBuildDir)</PyIncDirs> |
| 9 | + <IntDir>$(PyIntDir)</IntDir> |
| 10 | + <PyFileCopyCookie>$(PyBuildDir)copycookie$(Configuration)$(Platform)</PyFileCopyCookie> |
11 | 11 | </PropertyGroup>
|
12 | 12 | <ItemDefinitionGroup>
|
13 | 13 | <ClCompile>
|
|
22 | 22 | <GenerateMapFile>true</GenerateMapFile>
|
23 | 23 | </Link>
|
24 | 24 | </ItemDefinitionGroup>
|
25 |
| - <ItemGroup /> |
| 25 | + <ItemGroup> |
| 26 | + <PyOutputFiles Include="$(TargetPath)"> |
| 27 | + <Destination>$(PyWinDir)%(FileName)%(Extension)</Destination> |
| 28 | + </PyOutputFiles> |
| 29 | + <PyCookieFiles Include="$(PyBuildDir)copycookie*" Exclude="$(PyFileCopyCookie)"/> |
| 30 | + </ItemGroup> |
| 31 | + |
| 32 | + <!-- Copy PyOutputFiles to their target destination. |
| 33 | + To force this when switching between platforms/configurations which are already up-to-date (and as such, |
| 34 | + for which a build wouldn't even start because all outputs are effectively newer than the inputs) |
| 35 | + an empty file $(PyFileCopyCookie) is created serving as a record to indicate what was last copied, |
| 36 | + and any previous records are deleted. So when switching between builds which are otherwise up-to-date |
| 37 | + the tracker will notice a missing file and a build is started anyway (and it will just copy our files). --> |
| 38 | + <Target Name="CopyFilesToWinDir" AfterTargets="Build" |
| 39 | + Inputs="$(TargetPath)" Outputs="$(PyFileCopyCookie);@(PyOutputFiles->'%(Destination)')"> |
| 40 | + <Delete Files="@(PyCookieFiles)"/> |
| 41 | + <Touch Files="$(PyFileCopyCookie)" AlwaysCreate="true"/> |
| 42 | + <Copy SourceFiles="%(PyOutputFiles.Identity)" DestinationFiles="%(PyOutputFiles.Destination)"/> |
| 43 | + <WriteLinesToFile File="$(TLogLocation)$(ProjectName).write.u.tlog" Lines="$(PyFileCopyCookie);@(PyOutputFiles->'%(Destination)')" Overwrite="True"/> |
| 44 | + </Target> |
26 | 45 | </Project>
|
0 commit comments