Fix unset ZapRelocationType for fixup (#18589)
[platform/upstream/coreclr.git] / Tools / Microsoft.CSharp.Core.targets
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="@(CscCommandLineArgs)"
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
32     <PropertyGroup>
33       <!-- To match historical behavior, when inside VS11+ disable the warning from csc.exe indicating that no sources were passed in-->
34       <NoWarn Condition=" '$(BuildingInsideVisualStudio)' == 'true' and '$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' > '10.0' ">$(NoWarn);2008</NoWarn>
35     </PropertyGroup>
36
37     <ItemGroup Condition="'$(TargetingClr2Framework)'=='true'">
38       <ReferencePath>
39         <EmbedInteropTypes/>
40       </ReferencePath>
41     </ItemGroup>
42
43     <PropertyGroup>
44       <!-- If the user has specified AppConfigForCompiler, we'll use it. If they have not, but they set UseAppConfigForCompiler,
45                  then we'll use AppConfig -->
46       <AppConfigForCompiler Condition="'$(AppConfigForCompiler)' == '' and '$(UseAppConfigForCompiler)' == 'true'">$(AppConfig)</AppConfigForCompiler>
47
48       <!-- 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-->
49       <PdbFile Condition="'$(PdbFile)' == '' and '$(OutputType)' == 'winmdobj' and '$(_DebugSymbolsProduced)' == 'true'">$(IntermediateOutputPath)$(TargetName).compile.pdb</PdbFile>
50     </PropertyGroup>
51
52     <!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 -->
53     <PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')">
54       <Prefer32Bit>false</Prefer32Bit>
55     </PropertyGroup>
56
57     <ItemGroup Condition="('$(AdditionalFileItemNames)' != '')">
58       <AdditionalFileItems Include="$(AdditionalFileItemNames)" />
59       <AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" />
60     </ItemGroup>
61
62     <PropertyGroup Condition="'$(UseSharedCompilation)' == ''">
63       <UseSharedCompilation>true</UseSharedCompilation>
64     </PropertyGroup>
65
66     <!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->
67     <Csc  Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
68           AdditionalLibPaths="$(AdditionalLibPaths)"
69           AddModules="@(AddModules)"
70           AdditionalFiles="@(AdditionalFiles)"
71           AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
72           Analyzers="@(Analyzer)"
73           ApplicationConfiguration="$(AppConfigForCompiler)"
74           BaseAddress="$(BaseAddress)"
75           CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
76           CodeAnalysisRuleSet="$(ResolvedCodeAnalysisRuleSet)"
77           CodePage="$(CodePage)"
78           DebugType="$(DebugType)"
79           DefineConstants="$(DefineConstants)"
80           DelaySign="$(DelaySign)"
81           DisabledWarnings="$(NoWarn)"
82           DocumentationFile="@(DocFileItem)"
83           EmitDebugInformation="$(DebugSymbols)"
84           EnvironmentVariables="$(CscEnvironment)"
85           ErrorEndLocation="$(ErrorEndLocation)"
86           ErrorLog="$(ErrorLog)"
87           ErrorReport="$(ErrorReport)"
88           Features="$(Features)"
89           FileAlignment="$(FileAlignment)"
90           GenerateFullPaths="$(GenerateFullPaths)"
91           HighEntropyVA="$(HighEntropyVA)"
92           KeyContainer="$(KeyContainerName)"
93           KeyFile="$(KeyOriginatorFile)"
94           LangVersion="$(LangVersion)"
95           LinkResources="@(LinkResource)"
96           MainEntryPoint="$(StartupObject)"
97           ModuleAssemblyName="$(ModuleAssemblyName)"
98           NoConfig="true"
99           NoLogo="$(NoLogo)"
100           NoStandardLib="$(NoCompilerStandardLib)"
101           NoWin32Manifest="$(NoWin32Manifest)"
102           Optimize="$(Optimize)"
103           Deterministic="$(Deterministic)"
104           PublicSign="$(PublicSign)"
105           OutputAssembly="@(IntermediateAssembly)"
106           OverrideToolHost="$(OverrideToolHost)"
107           PdbFile="$(PdbFile)"
108           Platform="$(PlatformTarget)"
109           Prefer32Bit="$(Prefer32Bit)"
110           PreferredUILang="$(PreferredUILang)"
111           ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
112           References="@(ReferencePath)"
113           ReportAnalyzer="$(ReportAnalyzer)"
114           Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"
115           ResponseFiles="$(CompilerResponseFile)"
116           SkipCompilerExecution="$(SkipCompilerExecution)"
117           Sources="@(Compile)"
118           SubsystemVersion="$(SubsystemVersion)"
119           TargetType="$(OutputType)"
120           ToolExe="$(CscToolExe)"
121           ToolPath="$(CscToolPath)"
122           TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
123           UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
124           UseSharedCompilation="$(UseSharedCompilation)"
125           Utf8Output="$(Utf8Output)"
126           VsSessionGuid="$(VsSessionGuid)"
127           WarningLevel="$(WarningLevel)"
128           WarningsAsErrors="$(WarningsAsErrors)"
129           WarningsNotAsErrors="$(WarningsNotAsErrors)"
130           Win32Icon="$(ApplicationIcon)"
131           Win32Manifest="$(Win32Manifest)"
132           Win32Resource="$(Win32Resource)"
133           PathMap="$(PathMap)"
134           >
135       <Output TaskParameter="CommandLineArgs" ItemName="CscCommandLineArgs" />
136     </Csc>
137
138     <ItemGroup>
139       <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
140     </ItemGroup>
141
142     <CallTarget Targets="$(TargetsTriggeredByCompilation)" Condition="'$(TargetsTriggeredByCompilation)' != ''"/>
143   </Target>
144 </Project>