summaryrefslogtreecommitdiff
path: root/tests/src/IL.targets
blob: 36cff53035d67d6f72385a3c31339441dc95e5cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!-- Required by Microsoft.Common.targets -->
  <Target Name="CreateManifestResourceNames" Condition="'@(EmbeddedResource)' != ''" />

  <Target Name="CoreCompile"
          Inputs="$(MSBuildAllProjects);
                  @(Compile)"
          Outputs="@(IntermediateAssembly);"
          Returns=""
          DependsOnTargets="$(CoreCompileDependsOn)">
    <PropertyGroup>
      <_OutputTypeArgument Condition="'$(OutputType)' == 'Library'">/DLL</_OutputTypeArgument>
      <_OutputTypeArgument Condition="'$(OutputType)' == 'Exe'">/EXE</_OutputTypeArgument>
      <_IlasmSwitches>-QUIET -NOLOGO</_IlasmSwitches>
      <_IlasmSwitches Condition="'$(FoldIdenticalMethods)' == 'True'">$(_IlasmSwitches) -FOLD</_IlasmSwitches>
      <_IlasmSwitches Condition="'$(SizeOfStackReserve)' != ''">$(_IlasmSwitches) -STACK=$(SizeOfStackReserve)</_IlasmSwitches>
      <_IlasmSwitches Condition="'$(DebugType)' == 'Full'">$(_IlasmSwitches) -DEBUG</_IlasmSwitches>
      <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) -DEBUG=IMPL</_IlasmSwitches>
      <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) -DEBUG=OPT</_IlasmSwitches>
      <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) -OPTIMIZE</_IlasmSwitches>
    </PropertyGroup>

    <Exec Command="ilasm $(_OutputTypeArgument) /OUTPUT=@(IntermediateAssembly) $(_IlasmSwitches) @(Compile)">
      <Output TaskParameter="ExitCode" PropertyName="_ILAsmExitCode" />
    </Exec>
    <Error Text="ILAsm failed" Condition="'$(_ILAsmExitCode)' != '0'" />
  </Target>

  <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />

</Project>