source: trunk/win32/Lol.Fx.targets @ 1380

Last change on this file since 1380 was 1380, checked in by sam, 9 years ago

win32: add a custom build rule for '.lolfx' files. The files are properly
transformed to C++ but aren't compiled into the project yet.

File size: 2.7 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3  <ItemGroup>
4    <PropertyPageSchema
5      Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
6    <AvailableItemName
7      Include="LolFxCompile">
8      <Targets>LolFxCompile</Targets>
9    </AvailableItemName>
10  </ItemGroup>
11  <UsingTask
12    TaskName="LolFxCompile"
13    TaskFactory="XamlTaskFactory"
14    AssemblyName="Microsoft.Build.Tasks.v4.0">
15    <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
16  </UsingTask>
17  <Target
18    Name="LolFxCompile"
19    BeforeTargets="$(LolFxCompileBeforeTargets)"
20    AfterTargets="$(LolFxCompileAfterTargets)"
21    Condition="'@(LolFxCompile)' != ''"
22    DependsOnTargets="$(LolFxCompileDependsOn);ComputeLolFxCompileOutput"
23    Outputs="@(LolFxCompile-&gt;Metadata('CompileOut')-&gt;Distinct())"
24    Inputs="@(LolFxCompile);%(LolFxCompile.AdditionalDependencies);$(MSBuildProjectFile)">
25    <ItemGroup
26      Condition="'@(SelectedFiles)' != ''">
27      <LolFxCompile
28        Remove="@(LolFxCompile)"
29        Condition="'%(Identity)' != '@(SelectedFiles)'" />
30    </ItemGroup>
31    <ItemGroup>
32      <LolFxCompile_tlog
33        Include="%(LolFxCompile.Outputs)"
34        Condition="'%(LolFxCompile.Outputs)' != '' and '%(LolFxCompile.ExcludedFromBuild)' != 'true'">
35        <Source>@(LolFxCompile, '|')</Source>
36      </LolFxCompile_tlog>
37    </ItemGroup>
38    <Message
39      Importance="High"
40      Text="%(LolFxCompile.ExecutionDescription)" />
41    <WriteLinesToFile
42      Condition="'@(LolFxCompile_tlog)' != '' and '%(LolFxCompile_tlog.ExcludedFromBuild)' != 'true'"
43      File="$(IntDir)$(ProjectName).write.1.tlog"
44      Lines="^%(LolFxCompile_tlog.Source);@(LolFxCompile_tlog-&gt;'%(Fullpath)')" />
45    <ItemGroup>
46      <LolFxCompile>
47      </LolFxCompile>
48    </ItemGroup>
49    <LolFxCompile
50      Condition="'@(LolFxCompile)' != '' and '%(LolFxCompile.ExcludedFromBuild)' != 'true'"
51      CommandLineTemplate="%(LolFxCompile.CommandLineTemplate)"
52      IntDir="$(IntDir)"
53      Outputs="$(Outputs)"
54      FileName="%(FileName)"
55      Inputs="@(LolFxCompile)" />
56  </Target>
57
58  <PropertyGroup>
59    <ComputeLinkInputsTargets>
60      $(ComputeLinkInputsTargets);
61      ComputeLolFxCompileOutput;
62    </ComputeLinkInputsTargets>
63    <ComputeLibInputsTargets>
64      $(ComputeLibInputsTargets);
65      ComputeLolFxCompileOutput;
66    </ComputeLibInputsTargets>
67  </PropertyGroup>
68
69  <Target Name="ComputeLolFxCompileOutput" Condition="'@(LolFxCompile)' != ''">
70    <ItemGroup>
71      <LolFxCompile>
72        <CompileOut>$(IntDir)\%(FileName).lolfx.cpp</CompileOut>
73      </LolFxCompile>
74    </ItemGroup>
75    <ItemGroup>
76      <ClCompile Include="%(LolFxCompile.Outputs)" />
77    </ItemGroup>
78  </Target>
79
80</Project>
Note: See TracBrowser for help on using the repository browser.