1 <Project Sdk="Microsoft.NET.Sdk">
2 <!-- Generate Mono corelib version file -->
3 <Import Project="GenerateMonoCoreLibVersionFile.targets" />
6 <EnableDefaultItems>false</EnableDefaultItems>
7 <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
8 <GenerateResxSourceOmitGetResourceString>true</GenerateResxSourceOmitGetResourceString>
9 <GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
10 <EnsureRuntimePackageDependencies>false</EnsureRuntimePackageDependencies>
11 <TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
13 <!-- Ensure a portable PDB is emitted for the project. A PDB is needed for crossgen. -->
14 <DebugType>Portable</DebugType>
15 <DebugSymbols>true</DebugSymbols>
17 <!-- Force System.Private.CoreLib.dll into a special IL output directory -->
18 <OutputPath>$(RuntimeBinDir)IL/</OutputPath>
19 <Configurations>Debug;Release;Checked</Configurations>
20 <Platforms>x64;x86;arm;arm64;wasm</Platforms>
23 <!-- Note that various places in SPCL depend on this resource name i.e. TplEventSource -->
24 <ItemGroup Label="Embedded Resources">
25 <EmbeddedResource Include="$(LibrariesProjectRoot)\System.Private.CoreLib\src\Resources\Strings.resx">
26 <GenerateSource>true</GenerateSource>
27 <ClassName>System.SR</ClassName>
32 <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
33 <!-- This prevents the default MsBuild targets from referencing System.Core.dll -->
34 <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
35 <!-- These prevent the default MsBuild targets from referencing System.dll and mscorlib.dll -->
36 <ExcludeMscorlibFacade>true</ExcludeMscorlibFacade>
37 <RuntimeMetadataVersion>v4.0.30319</RuntimeMetadataVersion>
38 <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
39 <NoWarn>$(NoWarn),0419,0649</NoWarn>
40 <Nullable>enable</Nullable>
42 <!-- Ignore all previous constants since SPCL is sensitive to what is defined and the Sdk adds some by default -->
43 <DefineConstants>MONO;NETCOREAPP;SYSTEM_PRIVATE_CORELIB</DefineConstants>
44 <DisableImplicitConfigurationDefines>true</DisableImplicitConfigurationDefines>
46 <SkipCommonResourcesIncludes>true</SkipCommonResourcesIncludes>
47 <DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
50 <!-- Platform specific properties -->
51 <PropertyGroup Condition="'$(Platform)' == 'x64'">
52 <PlatformTarget>x64</PlatformTarget>
53 <Prefer32Bit>false</Prefer32Bit>
54 <DefineConstants>TARGET_64BIT;TARGET_AMD64;$(DefineConstants)</DefineConstants>
56 <PropertyGroup Condition="'$(Platform)' == 'x86'">
57 <PlatformTarget>x86</PlatformTarget>
58 <DefineConstants>TARGET_32BIT;$(DefineConstants)</DefineConstants>
60 <PropertyGroup Condition="'$(Platform)' == 'arm'">
61 <PlatformTarget>arm</PlatformTarget>
62 <DefineConstants>TARGET_32BIT;TARGET_ARM;$(DefineConstants)</DefineConstants>
64 <PropertyGroup Condition="'$(Platform)' == 'arm64'">
65 <PlatformTarget>AnyCPU</PlatformTarget>
66 <DefineConstants>TARGET_64BIT;TARGET_ARM64;$(DefineConstants)</DefineConstants>
68 <PropertyGroup Condition="'$(Platform)' == 'wasm'">
69 <PlatformTarget>AnyCPU</PlatformTarget>
70 <DefineConstants>TARGET_32BIT;$(DefineConstants)</DefineConstants>
73 <!-- Configuration specific properties -->
74 <PropertyGroup Condition="'$(Configuration)' == 'Debug' or '$(Configuration)' == 'Checked'">
75 <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Debug'">false</Optimize>
76 <Optimize Condition="'$(Optimize)' == '' and '$(Configuration)' == 'Checked'">true</Optimize>
77 <DefineConstants>_LOGGING;DEBUG;$(DefineConstants)</DefineConstants>
79 <PropertyGroup Condition="'$(Configuration)' == 'Release'">
80 <Optimize Condition="'$(Optimize)' == ''">true</Optimize>
83 <!-- Assembly attributes -->
85 <Description>$(AssemblyName)</Description>
90 <SignAssembly>true</SignAssembly>
91 <StrongNameKeyId>SilverlightPlatform</StrongNameKeyId>
98 <CommonPath>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'Common', 'src'))</CommonPath>
99 <BclSourcesRoot>$(MSBuildThisFileDirectory)src</BclSourcesRoot>
102 <!-- Compilation options -->
104 <!-- Mono specific build changes -->
106 <NoWarn>$(NoWarn),618,67</NoWarn>
108 <DefineConstants>MONO_FEATURE_SRE;$(DefineConstants)</DefineConstants>
110 <FeatureManagedEtwChannels>true</FeatureManagedEtwChannels>
111 <FeatureManagedEtw>true</FeatureManagedEtw>
112 <FeaturePortableTimer Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableTimer>
113 <FeaturePortableThreadPool Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableThreadPool>
114 <FeaturePerfTracing Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePerfTracing>
118 <DefineConstants Condition="'$(FeatureManagedEtw)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW</DefineConstants>
119 <DefineConstants Condition="'$(FeatureManagedEtwChannels)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW_CHANNELS</DefineConstants>
120 <DefineConstants Condition="'$(FeaturePerfTracing)' == 'true'">$(DefineConstants);FEATURE_PERFTRACING</DefineConstants>
123 <!-- ILLinker settings -->
125 <ILLinkTrimAssembly>true</ILLinkTrimAssembly>
126 <ILLinkDirectory>$(MSBuildThisFileDirectory)src\ILLink\</ILLinkDirectory>
130 <ILLinkDescriptorsXmls Include="$(ILLinkDirectory)ILLink.Descriptors.xml" />
131 <ILLinkDescriptorsXmls Include="$(CoreLibSharedDir)ILLink\ILLink.Descriptors.Shared.xml" />
133 <ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
134 <ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.$(Platform).xml"
135 Condition="Exists('$(ILLinkDirectory)ILLink.Substitutions.$(Platform).xml')" />
137 <ILLinkLinkAttributesXmls Include="$(ILLinkDirectory)ILLink.LinkAttributes.xml" />
138 <ILLinkLinkAttributesXmls Include="$(ILLinkDirectory)ILLink.LinkAttributes.$(Platform).xml"
139 Condition="Exists('$(ILLinkDirectory)ILLink.LinkAttributes.$(Platform).xml')" />
144 <Compile Include="$(BclSourcesRoot)\Mono\MonoListItem.cs" />
145 <Compile Include="$(BclSourcesRoot)\Mono\MonoDomain.cs" />
146 <Compile Include="$(BclSourcesRoot)\Mono\MonoDomainSetup.cs" />
147 <Compile Include="$(BclSourcesRoot)\Mono\MonoPInvokeCallbackAttribute.cs" />
148 <Compile Include="$(BclSourcesRoot)\Mono\RuntimeHandles.cs" />
149 <Compile Include="$(BclSourcesRoot)\System\ArgIterator.cs" />
150 <Compile Include="$(BclSourcesRoot)\System\Array.Mono.cs" />
151 <Compile Include="$(BclSourcesRoot)\System\Attribute.Mono.cs" />
152 <Compile Include="$(BclSourcesRoot)\System\Buffer.Mono.cs" />
153 <Compile Include="$(BclSourcesRoot)\System\Delegate.Mono.cs" />
154 <Compile Include="$(BclSourcesRoot)\System\Enum.Mono.cs" />
155 <Compile Include="$(BclSourcesRoot)\System\Environment.Mono.cs" />
156 <Compile Include="$(BclSourcesRoot)\System\Exception.Mono.cs" />
157 <Compile Include="$(BclSourcesRoot)\System\GC.Mono.cs" />
158 <Compile Include="$(BclSourcesRoot)\System\Object.Mono.cs" />
159 <Compile Include="$(BclSourcesRoot)\System\Math.Mono.cs" />
160 <Compile Include="$(BclSourcesRoot)\System\MathF.Mono.cs" />
161 <Compile Include="$(BclSourcesRoot)\System\MissingMemberException.Mono.cs" />
162 <Compile Include="$(BclSourcesRoot)\System\ModuleHandle.cs" />
163 <Compile Include="$(BclSourcesRoot)\System\MulticastDelegate.cs" />
164 <Compile Include="$(BclSourcesRoot)\System\NotImplemented.cs" />
165 <Compile Include="$(BclSourcesRoot)\System\Nullable.Mono.cs" />
166 <Compile Include="$(BclSourcesRoot)\System\RuntimeArgumentHandle.cs" />
167 <Compile Include="$(BclSourcesRoot)\System\RuntimeFieldHandle.cs" />
168 <Compile Include="$(BclSourcesRoot)\System\RuntimeMethodHandle.cs" />
169 <Compile Include="$(BclSourcesRoot)\System\RuntimeType.Mono.cs" />
170 <Compile Include="$(BclSourcesRoot)\System\RuntimeTypeHandle.cs" />
171 <Compile Include="$(BclSourcesRoot)\System\String.Mono.cs" />
172 <Compile Include="$(BclSourcesRoot)\System\Type.Mono.cs" />
173 <Compile Include="$(BclSourcesRoot)\System\TypeIdentifier.cs" />
174 <Compile Include="$(BclSourcesRoot)\System\TypedReference.cs" />
175 <Compile Include="$(BclSourcesRoot)\System\TypeLoadException.Mono.cs" />
176 <Compile Include="$(BclSourcesRoot)\System\TypeNameParser.cs" />
177 <Compile Include="$(BclSourcesRoot)\System\Utf8String.cs" />
178 <Compile Include="$(BclSourcesRoot)\System\ValueType.cs" />
179 <Compile Include="$(BclSourcesRoot)\System\WeakReference.Mono.cs" />
180 <Compile Include="$(BclSourcesRoot)\System\WeakReference.T.Mono.cs" />
181 <Compile Include="$(BclSourcesRoot)\System\__ComObject.cs" />
182 <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\ArraySortHelper.Mono.cs" />
183 <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\Comparer.Mono.cs" />
184 <Compile Include="$(BclSourcesRoot)\System\Collections\Generic\EqualityComparer.Mono.cs" />
185 <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Debugger.cs" />
186 <Compile Include="$(BclSourcesRoot)\System\Diagnostics\StackFrame.Mono.cs" />
187 <Compile Include="$(BclSourcesRoot)\System\Diagnostics\StackTrace.Mono.cs" />
188 <Compile Include="$(BclSourcesRoot)\System\Diagnostics\Tracing\EventPipe.Mono.cs" />
189 <Compile Include="$(BclSourcesRoot)\System\IO\Stream.Mono.cs" />
190 <Compile Include="$(BclSourcesRoot)\System\IO\FileLoadException.Mono.cs" />
191 <Compile Include="$(BclSourcesRoot)\System\Reflection\Assembly.Mono.cs" />
192 <Compile Include="$(BclSourcesRoot)\System\Reflection\AssemblyName.Mono.cs" />
193 <Compile Include="$(BclSourcesRoot)\System\Reflection\CustomAttribute.cs" />
194 <Compile Include="$(BclSourcesRoot)\System\Reflection\CustomAttributeData.cs" />
195 <Compile Include="$(BclSourcesRoot)\System\Reflection\CustomAttributeTypedArgument.Mono.cs" />
196 <Compile Include="$(BclSourcesRoot)\System\Reflection\FieldInfo.Mono.cs" />
197 <Compile Include="$(BclSourcesRoot)\System\Reflection\MemberInfo.Mono.cs" />
198 <Compile Include="$(BclSourcesRoot)\System\Reflection\MethodBase.Mono.cs" />
199 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeAssembly.cs" />
200 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeEventInfo.cs" />
201 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeFieldInfo.cs" />
202 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeLocalVariableInfo.cs" />
203 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeMethodBody.cs" />
204 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeMethodInfo.cs" />
205 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeModule.cs" />
206 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeParameterInfo.cs" />
207 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimePropertyInfo.cs" />
208 <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeExceptionHandlingClause.cs" />
209 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\AssemblyBuilder.Mono.cs" />
210 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\ConstructorBuilder.Mono.cs" />
211 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\ConstructorOnTypeBuilderInst.cs" />
212 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\CustomAttributeBuilder.Mono.cs" />
213 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\DerivedTypes.Mono.cs" />
214 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicILInfo.cs" />
215 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicMethod.cs" />
216 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicMethod.notsupported.cs" />
217 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\EnumBuilder.Mono.cs" />
218 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\EventBuilder.Mono.cs" />
219 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\EventOnTypeBuilderInst.cs" />
220 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\FieldBuilder.Mono.cs" />
221 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\FieldOnTypeBuilderInst.cs" />
222 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\GenericTypeParameterBuilder.cs" />
223 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\ILGenerator.Mono.cs" />
224 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\LocalBuilder.Mono.cs" />
225 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodBuilder.Mono.cs" />
226 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\MethodOnTypeBuilderInst.cs" />
227 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\ModuleBuilder.Mono.cs" />
228 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\MonoArrayMethod.cs" />
229 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\ParameterBuilder.Mono.cs" />
230 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\PropertyBuilder.Mono.cs" />
231 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\PropertyOnTypeBuilderInst.cs" />
232 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\SignatureHelper.cs" />
233 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeBuilder.Mono.cs" />
234 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\TypeBuilderInstantiation.cs" />
235 <Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\UnmanagedMarshal.cs" />
236 <Compile Include="$(BclSourcesRoot)\System\Reflection\Metadata\AssemblyExtensions.cs" />
237 <Compile Include="$(BclSourcesRoot)\System\Resources\ManifestBasedResourceGroveler.Mono.cs" />
238 <Compile Include="$(BclSourcesRoot)\System\Runtime\GCSettings.Mono.cs" />
239 <Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\DependentHandle.cs" />
240 <Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\JitHelpers.cs" />
241 <Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeHelpers.Mono.cs" />
242 <Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeFeature.Mono.cs" />
243 <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\GCHandle.Mono.cs" />
244 <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\Marshal.Mono.cs" />
245 <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\MemoryMarshal.Mono.cs" />
246 <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\MarshalAsAttribute.Mono.cs" />
247 <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\NativeLibrary.Mono.cs" />
248 <Compile Include="$(BclSourcesRoot)\System\Runtime\InteropServices\SafeHandle.Mono.cs" />
249 <Compile Include="$(BclSourcesRoot)\System\Runtime\Intrinsics\X86\X86Base.Mono.cs" />
250 <Compile Include="$(BclSourcesRoot)\System\Runtime\Loader\AssemblyLoadContext.Mono.cs" />
251 <Compile Include="$(BclSourcesRoot)\System\Runtime\Remoting\Contexts\Context.cs" />
252 <Compile Include="$(BclSourcesRoot)\System\Security\DynamicSecurityMethodAttribute.cs" />
253 <Compile Include="$(BclSourcesRoot)\System\Text\Utf8Span.cs" />
254 <Compile Include="$(BclSourcesRoot)\System\Threading\Interlocked.Mono.cs" />
255 <Compile Include="$(BclSourcesRoot)\System\Threading\Monitor.Mono.cs" />
256 <Compile Include="$(BclSourcesRoot)\System\Threading\Overlapped.cs" />
257 <Compile Include="$(BclSourcesRoot)\System\Threading\PreAllocatedOverlapped.cs" />
258 <Compile Include="$(BclSourcesRoot)\System\Threading\StackCrawlMark.cs" />
259 <Compile Include="$(BclSourcesRoot)\System\Threading\Thread.Mono.cs" />
260 <Compile Include="$(BclSourcesRoot)\System\Threading\ThreadPool.Mono.cs" />
261 <Compile Include="$(BclSourcesRoot)\System\Threading\LowLevelLock.cs" />
262 <Compile Include="$(BclSourcesRoot)\System\Threading\WaitHandle.Mono.cs" />
264 <ItemGroup Condition="'$(TargetsUnix)' == 'true' or '$(TargetsBrowser)' == 'true'">
265 <Compile Include="$(BclSourcesRoot)\Microsoft\Win32\SafeHandles\SafeWaitHandle.Unix.Mono.cs" />
266 <Compile Include="$(BclSourcesRoot)\System\Environment.Unix.Mono.cs" />
267 <Compile Include="$(BclSourcesRoot)\System\Threading\EventWaitHandle.Unix.Mono.cs" />
268 <Compile Include="$(BclSourcesRoot)\System\Threading\Mutex.Unix.Mono.cs" />
269 <Compile Include="$(BclSourcesRoot)\System\Threading\Semaphore.Unix.Mono.cs" />
270 <Compile Include="$(BclSourcesRoot)\System\Threading\LowLevelLifoSemaphore.Unix.Mono.cs" />
272 <Compile Include="$(BclSourcesRoot)\System\IO\MonoIOError.cs" />
274 <ItemGroup Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">
275 <Compile Include="$(BclSourcesRoot)\System\Environment.iOS.cs" />
276 <Compile Include="$(CommonPath)Interop\OSX\System.Native\Interop.SearchPath.cs">
277 <Link>Common\Interop\OSX\Interop.SearchPath.cs</Link>
280 <ItemGroup Condition="'$(TargetsBrowser)' == 'true'">
281 <Compile Include="$(BclSourcesRoot)\System\Threading\TimerQueue.Browser.Mono.cs" />
282 <Compile Include="$(BclSourcesRoot)\System\Threading\ThreadPool.Browser.Mono.cs" />
283 <Compile Include="$(BclSourcesRoot)\System\Threading\Thread.Browser.Mono.cs" />
284 <Compile Include="$(LibrariesProjectRoot)\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.PlatformNotSupported.cs" />
286 <ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
287 <Compile Include="$(BclSourcesRoot)\System\Threading\Thread.UnixOrWindows.Mono.cs" />
290 <Compile Include="$(BclSourcesRoot)\Mono\RuntimeStructs.cs" />
291 <Compile Include="$(BclSourcesRoot)\Mono\RuntimeMarshal.cs" />
292 <Compile Include="$(BclSourcesRoot)\Mono\SafeStringMarshal.cs" />
293 <Compile Include="$(BclSourcesRoot)\Mono\SafeGPtrArrayHandle.cs" />
294 <Compile Include="$(BclSourcesRoot)\System\TypeSpec.cs" />
297 <Import Project="$(LibrariesProjectRoot)\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems" Label="Shared" />
299 <Target Name="CopyCoreLibToBinDir" AfterTargets="Build">
300 <Copy SourceFiles="$(RuntimeBinDir)/IL/System.Private.CoreLib.dll;$(RuntimeBinDir)/IL/System.Private.CoreLib.pdb"
301 DestinationFolder="$(RuntimeBinDir)"
302 SkipUnchangedFiles="true" />