2014-05-05 11:18:27 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GenerateHeaders">
|
|
|
|
|
2015-01-02 10:49:23 +00:00
|
|
|
<Import Project="env.props" Condition="$(PyEnvIncluded)!=True"/>
|
|
|
|
|
2015-04-22 17:38:05 +01: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 11:18:27 +01:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
2015-01-02 10:49:23 +00:00
|
|
|
<DestDir>$(PyBuildDir)genhdr\</DestDir>
|
2015-04-22 17:38:05 +01:00
|
|
|
<PySrcDir>$(PyBaseDir)py\</PySrcDir>
|
2014-05-05 11:18:27 +01:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Target Name="MakeDestDir">
|
|
|
|
<MakeDir Directories="$(DestDir)"/>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="MakeQstrData" DependsOnTargets="MakeDestDir">
|
|
|
|
<PropertyGroup>
|
|
|
|
<PreProc>$(DestDir)qstrdefs.preprocessed.h</PreProc>
|
2015-01-02 10:49:23 +00:00
|
|
|
<QstrDefs>$(PyBaseDir)unix\qstrdefsport.h</QstrDefs>
|
2014-05-05 11:18:27 +01:00
|
|
|
<DestFile>$(DestDir)qstrdefs.generated.h</DestFile>
|
2015-01-02 15:31:49 +00:00
|
|
|
<TmpFile>$(DestFile).tmp</TmpFile>
|
2014-05-05 11:18:27 +01:00
|
|
|
</PropertyGroup>
|
2015-01-02 10:49:23 +00:00
|
|
|
<ItemGroup>
|
|
|
|
<PyIncDirs Include="$(PyIncDirs)"/>
|
|
|
|
</ItemGroup>
|
2015-01-02 15:31:49 +00:00
|
|
|
<Exec Command="cl /nologo /I@(PyIncDirs, ' /I') /Fi$(PreProc) /P $(PySrcDir)qstrdefs.h"/>
|
|
|
|
<Exec Command="python $(PySrcDir)makeqstrdata.py $(PreProc) $(QstrDefs) > $(TmpFile)"/>
|
|
|
|
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="CopyFileIfDifferent" Properties="SourceFile=$(TmpFile);DestFile=$(DestFile)"/>
|
2014-05-05 11:18:27 +01:00
|
|
|
</Target>
|
|
|
|
|
2015-04-22 17:38:05 +01:00
|
|
|
<Target Name="MakeVersionHdr" DependsOnTargets="MakeDestDir">
|
2014-05-05 11:18:27 +01:00
|
|
|
<PropertyGroup>
|
2015-04-22 17:38:05 +01:00
|
|
|
<DestFile>$(DestDir)mpversion.h</DestFile>
|
2015-01-02 15:31:49 +00:00
|
|
|
<TmpFile>$(DestFile).tmp</TmpFile>
|
2014-05-05 11:18:27 +01:00
|
|
|
</PropertyGroup>
|
2015-04-22 17:38:05 +01:00
|
|
|
<Exec Command="python $(PySrcDir)makeversionhdr.py $(TmpFile)"/>
|
2015-01-02 15:31:49 +00: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 15:03:38 +01:00
|
|
|
<Output TaskParameter="ExitCode" PropertyName="FilesDiffer" />
|
|
|
|
</Exec>
|
2015-01-02 15:31:49 +00:00
|
|
|
<Copy SourceFiles="$(SourceFile)" DestinationFiles="$(DestFile)" Condition="'$(FilesDiffer)'!='0'"/>
|
2014-05-05 11:18:27 +01:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
</Project>
|