2014-05-05 06:18:27 -04:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GenerateHeaders">
|
|
|
|
|
2015-11-12 03:42:12 -05:00
|
|
|
<Import Project="paths.props" Condition="'$(PyPathsIncluded)' != 'True'"/>
|
2015-01-02 05:49:23 -05:00
|
|
|
|
2015-04-22 12:38:05 -04:00
|
|
|
<!--Generate qstrdefs.h and mpversion.h similar to what is done in py/py.mk-->
|
|
|
|
<Target Name="GenerateHeaders" DependsOnTargets="MakeQstrData;MakeVersionHdr">
|
2014-05-05 06:18:27 -04:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
2015-01-02 05:49:23 -05:00
|
|
|
<DestDir>$(PyBuildDir)genhdr\</DestDir>
|
2015-04-22 12:38:05 -04:00
|
|
|
<PySrcDir>$(PyBaseDir)py\</PySrcDir>
|
2015-11-07 14:00:26 -05:00
|
|
|
<PyPython Condition="'$(PyPython)' == ''">python</PyPython>
|
2014-05-05 06:18:27 -04:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Target Name="MakeDestDir">
|
|
|
|
<MakeDir Directories="$(DestDir)"/>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="MakeQstrData" DependsOnTargets="MakeDestDir">
|
|
|
|
<PropertyGroup>
|
|
|
|
<PreProc>$(DestDir)qstrdefs.preprocessed.h</PreProc>
|
2015-01-02 05:49:23 -05:00
|
|
|
<QstrDefs>$(PyBaseDir)unix\qstrdefsport.h</QstrDefs>
|
2014-05-05 06:18:27 -04:00
|
|
|
<DestFile>$(DestDir)qstrdefs.generated.h</DestFile>
|
2015-01-02 10:31:49 -05:00
|
|
|
<TmpFile>$(DestFile).tmp</TmpFile>
|
2014-05-05 06:18:27 -04:00
|
|
|
</PropertyGroup>
|
2015-01-02 05:49:23 -05:00
|
|
|
<ItemGroup>
|
|
|
|
<PyIncDirs Include="$(PyIncDirs)"/>
|
|
|
|
</ItemGroup>
|
2015-01-02 10:31:49 -05:00
|
|
|
<Exec Command="cl /nologo /I@(PyIncDirs, ' /I') /Fi$(PreProc) /P $(PySrcDir)qstrdefs.h"/>
|
2015-11-07 14:00:26 -05:00
|
|
|
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdata.py $(PreProc) $(QstrDefs) > $(TmpFile)"/>
|
2015-01-02 10:31:49 -05:00
|
|
|
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="CopyFileIfDifferent" Properties="SourceFile=$(TmpFile);DestFile=$(DestFile)"/>
|
2014-05-05 06:18:27 -04:00
|
|
|
</Target>
|
|
|
|
|
2015-04-22 12:38:05 -04:00
|
|
|
<Target Name="MakeVersionHdr" DependsOnTargets="MakeDestDir">
|
2014-05-05 06:18:27 -04:00
|
|
|
<PropertyGroup>
|
2015-04-22 12:38:05 -04:00
|
|
|
<DestFile>$(DestDir)mpversion.h</DestFile>
|
2015-01-02 10:31:49 -05:00
|
|
|
<TmpFile>$(DestFile).tmp</TmpFile>
|
2014-05-05 06:18:27 -04:00
|
|
|
</PropertyGroup>
|
2015-11-07 14:00:26 -05:00
|
|
|
<Exec Command="$(PyPython) $(PySrcDir)makeversionhdr.py $(TmpFile)"/>
|
2015-01-02 10:31:49 -05:00
|
|
|
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="CopyFileIfDifferent" Properties="SourceFile=$(TmpFile);DestFile=$(DestFile)"/>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<!--Copies SourceFile to DestFile only if SourceFile's content differs from DestFile's.
|
|
|
|
We use this to 'touch' the generated files only when they are really newer
|
|
|
|
so a build is only triggered if the generated content actually changed,
|
|
|
|
and not just because the file date changed since the last build-->
|
|
|
|
<Target Name="CopyFileIfDifferent">
|
|
|
|
<Exec Command="fc /B $(SourceFile) $(DestFile) > NUL 2>&1" IgnoreExitCode="true">
|
2014-05-28 10:03:38 -04:00
|
|
|
<Output TaskParameter="ExitCode" PropertyName="FilesDiffer" />
|
|
|
|
</Exec>
|
2015-01-02 10:31:49 -05:00
|
|
|
<Copy SourceFiles="$(SourceFile)" DestinationFiles="$(DestFile)" Condition="'$(FilesDiffer)'!='0'"/>
|
2014-05-05 06:18:27 -04:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
</Project>
|