Microsoft.CSharp.Core.targets 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  2. <Target
  3. Name="CoreCompile"
  4. Inputs="$(MSBuildAllProjects);
  5. @(Compile);
  6. @(_CoreCompileResourceInputs);
  7. $(ApplicationIcon);
  8. $(AssemblyOriginatorKeyFile);
  9. @(ReferencePath);
  10. @(CompiledLicenseFile);
  11. @(LinkResource);
  12. @(EmbeddedDocumentation);
  13. $(Win32Resource);
  14. $(Win32Manifest);
  15. @(CustomAdditionalCompileInputs);
  16. $(ResolvedCodeAnalysisRuleSet)"
  17. Outputs="@(DocFileItem);
  18. @(IntermediateAssembly);
  19. @(_DebugSymbolsIntermediatePath);
  20. $(NonExistentFile);
  21. @(CustomAdditionalCompileOutputs)"
  22. Returns=""
  23. DependsOnTargets="$(CoreCompileDependsOn)"
  24. >
  25. <!-- These two compiler warnings are raised when a reference is bound to a different version
  26. than specified in the assembly reference version number. MSBuild raises the same warning in this case,
  27. so the compiler warning would be redundant. -->
  28. <PropertyGroup Condition="('$(TargetFrameworkVersion)' != 'v1.0') and ('$(TargetFrameworkVersion)' != 'v1.1')">
  29. <NoWarn>$(NoWarn);1701;1702</NoWarn>
  30. </PropertyGroup>
  31. <PropertyGroup>
  32. <!-- To match historical behavior, when inside VS11+ disable the warning from csc.exe indicating that no sources were passed in-->
  33. <NoWarn Condition=" '$(BuildingInsideVisualStudio)' == 'true' and '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' > '10.0' ">$(NoWarn);2008</NoWarn>
  34. </PropertyGroup>
  35. <ItemGroup Condition="'$(TargetingClr2Framework)'=='true'">
  36. <ReferencePath>
  37. <EmbedInteropTypes/>
  38. </ReferencePath>
  39. </ItemGroup>
  40. <PropertyGroup>
  41. <!-- If the user has specified AppConfigForCompiler, we'll use it. If they have not, but they set UseAppConfigForCompiler,
  42. then we'll use AppConfig -->
  43. <AppConfigForCompiler Condition="'$(AppConfigForCompiler)' == '' and '$(UseAppConfigForCompiler)' == 'true'">$(AppConfig)</AppConfigForCompiler>
  44. <!-- If we are targeting winmdobj we want to specifically the pdbFile property since we do not want it to collide with the output of winmdexp-->
  45. <PdbFile Condition="'$(PdbFile)' == '' and '$(OutputType)' == 'winmdobj' and '$(_DebugSymbolsProduced)' == 'true'">$(IntermediateOutputPath)$(TargetName).compile.pdb</PdbFile>
  46. </PropertyGroup>
  47. <!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 -->
  48. <PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')">
  49. <Prefer32Bit>false</Prefer32Bit>
  50. </PropertyGroup>
  51. <ItemGroup Condition="('$(AdditionalFileItemNames)' != '')">
  52. <AdditionalFileItems Include="$(AdditionalFileItemNames)" />
  53. <AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" />
  54. </ItemGroup>
  55. <PropertyGroup Condition="'$(UseSharedCompilation)' == ''">
  56. <UseSharedCompilation>true</UseSharedCompilation>
  57. </PropertyGroup>
  58. <!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->
  59. <Csc Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
  60. AdditionalLibPaths="$(AdditionalLibPaths)"
  61. AddModules="@(AddModules)"
  62. AdditionalFiles="@(AdditionalFiles)"
  63. AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
  64. Analyzers="@(Analyzer)"
  65. ApplicationConfiguration="$(AppConfigForCompiler)"
  66. BaseAddress="$(BaseAddress)"
  67. CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
  68. CodeAnalysisRuleSet="$(ResolvedCodeAnalysisRuleSet)"
  69. CodePage="$(CodePage)"
  70. DebugType="$(DebugType)"
  71. DefineConstants="$(DefineConstants)"
  72. DelaySign="$(DelaySign)"
  73. DisabledWarnings="$(NoWarn)"
  74. DocumentationFile="@(DocFileItem)"
  75. EmitDebugInformation="$(DebugSymbols)"
  76. EnvironmentVariables="$(CscEnvironment)"
  77. ErrorEndLocation="$(ErrorEndLocation)"
  78. ErrorLog="$(ErrorLog)"
  79. ErrorReport="$(ErrorReport)"
  80. FileAlignment="$(FileAlignment)"
  81. GenerateFullPaths="$(GenerateFullPaths)"
  82. HighEntropyVA="$(HighEntropyVA)"
  83. KeyContainer="$(KeyContainerName)"
  84. KeyFile="$(KeyOriginatorFile)"
  85. LangVersion="$(LangVersion)"
  86. LinkResources="@(LinkResource)"
  87. MainEntryPoint="$(StartupObject)"
  88. ModuleAssemblyName="$(ModuleAssemblyName)"
  89. NoConfig="true"
  90. NoLogo="$(NoLogo)"
  91. NoStandardLib="$(NoCompilerStandardLib)"
  92. NoWin32Manifest="$(NoWin32Manifest)"
  93. Optimize="$(Optimize)"
  94. OutputAssembly="@(IntermediateAssembly)"
  95. PdbFile="$(PdbFile)"
  96. Platform="$(PlatformTarget)"
  97. Prefer32Bit="$(Prefer32Bit)"
  98. PreferredUILang="$(PreferredUILang)"
  99. References="@(ReferencePath)"
  100. ReportAnalyzer="$(ReportAnalyzer)"
  101. Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"
  102. ResponseFiles="$(CompilerResponseFile)"
  103. Sources="@(Compile)"
  104. SubsystemVersion="$(SubsystemVersion)"
  105. TargetType="$(OutputType)"
  106. ToolExe="$(CscToolExe)"
  107. ToolPath="$(CscToolPath)"
  108. TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
  109. UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
  110. UseSharedCompilation="$(UseSharedCompilation)"
  111. Utf8Output="$(Utf8Output)"
  112. VsSessionGuid="$(VsSessionGuid)"
  113. WarningLevel="$(WarningLevel)"
  114. WarningsAsErrors="$(WarningsAsErrors)"
  115. WarningsNotAsErrors="$(WarningsNotAsErrors)"
  116. Win32Icon="$(ApplicationIcon)"
  117. Win32Manifest="$(Win32Manifest)"
  118. Win32Resource="$(Win32Resource)"
  119. />
  120. <ItemGroup>
  121. <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
  122. </ItemGroup>
  123. <CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/>
  124. </Target>
  125. </Project>