summaryrefslogtreecommitdiff
path: root/src/mscorlib/System.Private.CoreLib.csproj
blob: f1f944a6f64466ffc99a10cad5950e97d75addb8 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!-- Always use latest Roslyn compiler -->
  <Import Project="..\..\Tools\net45\roslyn\build\Microsoft.Net.Compilers.props" Condition="'$(OS)'=='Windows_NT' and '$(UseLegacyCompiler)'!='true'" />

  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  
  <!-- Include common build properties -->
  <Import Project="..\..\dir.props" />
 
  <!-- Compilation options -->
  <PropertyGroup>
    <AvailablePlatforms>amd64,x86,arm,arm-softfp,arm64</AvailablePlatforms>
    <Configuration Condition=" '$(Configuration)' == '' ">$(BuildType)</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">$(BuildArch)</Platform>
    <!-- The CLR properties use amd64 as their platform string, we want to keep in sync with those, so set Platform appropriately,
         though still use the 'x64' output path (see use of BuildArch below) -->
    <Platform Condition=" '$(Platform)' == 'x64' ">amd64</Platform>
    <Platform Condition=" '$(Platform)' == 'arm-softfp' ">arm</Platform>
    <ProjectGuid>{3DA06C3A-2E7B-4CB7-80ED-9B12916013F9}</ProjectGuid>

    <OutputType>Library</OutputType>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    
    <!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
    <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
    <!-- These prevent the default MsBuild targets from referencing System.dll and mscorlib.dll -->
    <NoStdLib>true</NoStdLib>
    <NoCompilerStandardLib>true</NoCompilerStandardLib>
    
    <SubsystemVersion>6.00</SubsystemVersion>
    <UTF8OutPut>true</UTF8OutPut>
    <HighEntropyVA>true</HighEntropyVA>
    <ErrorReport>prompt</ErrorReport>
    <CLSCompliant>true</CLSCompliant>
    <WarningLevel>4</WarningLevel>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <WarningsNotAsErrors>$(WarningsNotAsErrors);618</WarningsNotAsErrors>
    <NoWarn>649,3019,414,169,3015</NoWarn>
    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>

    <BclRewriterModelFile>$(MSBuildThisFileDirectory)model.xml</BclRewriterModelFile>

    <SignAssembly>true</SignAssembly>
    <DelaySign>true</DelaySign>

    <DefineConstants>$(DefineConstants);_USE_NLS_PLUS_TABLE;RESOURCE_SATELLITE_CONFIG;INSIDE_CLR;CODE_ANALYSIS_BASELINE</DefineConstants>
  </PropertyGroup>

  <!-- Add Serviceable attribute to the project's metadata -->
  <ItemGroup>
    <AssemblyMetadata Include="Serviceable">
        <Value>True</Value>
    </AssemblyMetadata>
  </ItemGroup>

  <!-- Platform specific properties -->
  <PropertyGroup Condition="'$(Platform)' == 'amd64'">
    <PlatformTarget>x64</PlatformTarget>
    <Prefer32Bit>false</Prefer32Bit>
    <BaseAddress>0x180000000</BaseAddress>
    <DefineConstants>BIT64;AMD64;$(DefineConstants)</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)' == 'x86'">
    <PlatformTarget>x86</PlatformTarget>
    <BaseAddress>0x10000000</BaseAddress>
    <DefineConstants>BIT32;$(DefineConstants)</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)' == 'arm'">
    <PlatformTarget>arm</PlatformTarget>
    <DefineConstants>BIT32;ARM;$(DefineConstants)</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)' == 'arm64'">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DefineConstants>BIT64;ARM64;$(DefineConstants)</DefineConstants>
  </PropertyGroup>
  
  <!-- Configuration specific properties -->
  <PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">
    <DebugSymbols>true</DebugSymbols>
    <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Debug'">false</Optimize>
    <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Checked'">true</Optimize>
    <DebugType>full</DebugType>
    <DefineConstants>DBG;_DEBUG;_LOGGING;DEBUG;TRACE;$(DefineConstants)</DefineConstants>
    <DefineConstants Condition="'$(Platform)' == 'x86' or '$(Platform)' == 'amd64'">CODE_ANALYSIS;$(DefineConstants)</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <DebugSymbols>true</DebugSymbols>
    <Optimize Condition="'$(Optimize)' == ''">true</Optimize>
    <DebugType>pdbOnly</DebugType>
    <DefineConstants>TRACE;$(DefineConstants)</DefineConstants>
  </PropertyGroup>

  <!-- Roslyn does not support writing PDBs on Unix -->
  <PropertyGroup Condition="'$(OsEnvironment)' == 'Unix'">
    <DebugSymbols>false</DebugSymbols>
    <DebugType>none</DebugType>
  </PropertyGroup>

  <!-- Assembly attributes -->
  <PropertyGroup>
    <AssemblyName>System.Private.CoreLib</AssemblyName>
    <AssemblyVersion>4.0.0.0</AssemblyVersion>
    <MajorVersion>4</MajorVersion>
    <MinorVersion>6</MinorVersion>
  </PropertyGroup>
  <ItemGroup>
    <AssemblyInfoLines Include="[assembly: System.Resources.SatelliteContractVersion(&quot;$(AssemblyVersion)&quot;)]" />
    <AssemblyInfoLines Include="[assembly: System.Security.AllowPartiallyTrustedCallers]" />
    <AssemblyInfoLines Include="[assembly: System.Runtime.InteropServices.ComVisible(false)]" />
    <AssemblyInfoLines Include="[assembly: System.Resources.NeutralResourcesLanguage(&quot;en-US&quot;)]" />
  </ItemGroup>

  <!--
    Helper Paths
  -->
  <PropertyGroup>
    <PostProcessingToolsPath Condition="'$(PostProcessingToolsPath)'==''">$(MSBuildThisFileDirectory)Tools\PostProcessingTools.targets</PostProcessingToolsPath>
    <CommonPath>$(MSBuildThisFileDirectory)Common</CommonPath>
    <BclSourcesRoot>$(MSBuildThisFileDirectory)src</BclSourcesRoot>
    <CoreFxSourcesRoot>$(MSBuildThisFileDirectory)corefx</CoreFxSourcesRoot>
    <MscorlibDir>$(MSBuildThisFileDirectory)</MscorlibDir>
    <NlpObjDir>$(BclSourcesRoot)\System\Globalization\Tables</NlpObjDir>
  </PropertyGroup>
  
  <!-- Output paths -->
  <PropertyGroup>
    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$(RootBinDir)obj</BaseIntermediateOutputPath>
    <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseIntermediateOutputPath)\$(BuildOS).$(BuildArch).$(Configuration)</IntermediateOutputPath>
    <OutputPath Condition="'$(OutputPath)' == ''">$(BaseIntermediateOutputPath)\$(BuildOS).$(BuildArch).$(Configuration)</OutputPath>
    <FinalOutputPath Condition="'$(FinalOutputPath)' == ''">$(BinDir)</FinalOutputPath>
  </PropertyGroup>
  
  <!-- Msbuild variables needed to get CoreCLR features to be set properly. -->
  <PropertyGroup>
    <ClrProduct>core_clr</ClrProduct>
    <BuildForCoreSystem>true</BuildForCoreSystem>
    
    <!-- These are needed by BCLRewriter -->
    <_BuildType Condition="'$(Configuration)' == 'Debug'">chk</_BuildType>
    <_BuildType Condition="'$(Configuration)' == 'Checked'">chk</_BuildType>
    <_BuildType Condition="'$(Configuration)' == 'Release'">ret</_BuildType>

    <!-- These are needed to make sure we have the right set of defines -->
    <TargetArch Condition="'$(Platform)'=='x86'">i386</TargetArch>
    <TargetArch Condition="'$(Platform)'!='x86'">$(Platform)</TargetArch>
  </PropertyGroup>
  
  <!-- CLR Features -->
  <Import Project="$(MSBuildThisFileDirectory)..\..\clr.coreclr.props" />
  <Import Project="$(MSBuildThisFileDirectory)..\..\clr.defines.targets" />

  <!-- Sources -->
  <Import Project="$(MSBuildThisFileDirectory)\mscorlib.shared.sources.props" />

  <!-- Include additional sources shared files in the compilation -->
  <ItemGroup>
    <!-- These are files are preprocessed  -->
    <MscorlibSources Include="$(CommonPath)\Preprocessed\AssemblyRefs.g.cs" />

    <!-- These files are shared with other framework components and don't live the same folder as the rest of them-->
    <MscorlibSources Include="$(CommonPath)\PinnableBufferCache.cs" />

    <!-- Include Internals visible to file in the compilation -->
    <MscorlibSources Include="$(BclSourcesRoot)\mscorlib.Friends.cs" />
  </ItemGroup>

  <ItemGroup>
    <!-- We want the sources to show up nicely in VS-->
    <Compile Include="@(MscorlibSources)">
    </Compile>
  </ItemGroup>
  
  <!-- Resources -->
  <ItemGroup>
    <SplitTextStringResource Include="$(BclSourcesRoot)\System.Private.CoreLib.txt">
      <ResFile>System.Private.CoreLib</ResFile>
      <ResGenDefines>$(DefineConstants)</ResGenDefines>
    </SplitTextStringResource>
  </ItemGroup>

  <PropertyGroup>
    <CheckCDefines Condition="'$(CheckCDefines)'==''">true</CheckCDefines>
  </PropertyGroup>

  <Target Name="CDefineChecker" BeforeTargets="Build" Condition="'$(CheckCDefines)'=='true'">
    <!-- Compiler Definition Verification -->
    <Message Importance="High" Text="============" />
    <PropertyGroup>
      <IgnoreDefineConstants>FEATURE_IMPLICIT_TLS;FEATURE_HIJACK</IgnoreDefineConstants>
      <CMakeDefinitionSaveFile>$(IntermediateOutputPath)\cmake.definitions</CMakeDefinitionSaveFile>
    </PropertyGroup>
    <Exec Command='python $(MSBuildThisFileDirectory)..\scripts\check-definitions.py "$(CMakeDefinitionSaveFile)" "$(DefineConstants)" "$(IgnoreDefineConstants)" ' />
    <Message Importance="High" Text="============" />
  </Target>

  <ItemGroup>
    <EmbeddedResource Include="$(NlpObjDir)\charinfo.nlp">
      <LogicalName>charinfo.nlp</LogicalName>
    </EmbeddedResource>
  </ItemGroup>

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.Targets" />

  <PropertyGroup>
    <StrongNameSig>Silverlight</StrongNameSig>
  </PropertyGroup>

  <!-- Import signing tools -->
  <Import Condition="Exists('$(ToolsDir)\sign.targets')" Project="$(ToolsDir)\sign.targets" />

  <!-- Overwrite the key that we are going to use for signing -->
  <PropertyGroup>
    <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Tools\Signing\mscorlib.snk</AssemblyOriginatorKeyFile>
  </PropertyGroup>

  <Import Project="$(MSBuildThisFileDirectory)Tools\Versioning\GenerateVersionInfo.targets"/>
  <!-- Override versioning targets -->
  <Import Condition="Exists('$(ToolsDir)versioning.targets')" Project="$(ToolsDir)versioning.targets" />

  <PropertyGroup>
    <!-- Use a different nativeresource file to avoid conflicts with mscorlib-->
    <Win32Resource Condition="'$(GenerateNativeVersionInfo)'=='true'">$(IntermediateOutputPath)\System.Private.CoreLib.res</Win32Resource>
  </PropertyGroup>

  <Import Project="GenerateSplitStringResources.targets"/>
  <Import Project="GenerateCompilerResponseFile.targets"/>
  <Import Project="$(PostProcessingToolsPath)" />
</Project>