1 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <!--*****************************************************-->
3 <!--This MSBuild project file was automatically generated-->
4 <!--from the original SOURCES/DIRS file by the KBC tool.-->
5 <!--*****************************************************-->
6 <!--Import the settings-->
7 <Import Project="$(_NTDRIVE)$(_NTROOT)\InternalAPIs\NDP_Common\inc\Microsoft.Ndp.Settings.targets" />
9 <!--Leaf project Properties-->
11 <Clrbase>$(_NTDRIVE)$(_NTROOT)\ndp\clr</Clrbase>
12 <ClrSrcDirectory>$(Clrbase)\src\</ClrSrcDirectory>
14 <ClrLibDest Condition="('$(BuildProjectName)' == '')">$(IntraPartitionAPIsPath)\$(LibSubPath)</ClrLibDest>
15 <ClrLibDest Condition="('$(BuildProjectName)' == 'CoreCLR' or '$(BuildProjectName)' == 'CoreSys')">$(IntraPartitionAPIsPath)\CORElib\$(InterApiType)\$(RealBuildArchitecture)</ClrLibDest>
16 <ClrLibPath>$(ClrLibDest)</ClrLibPath>
18 <!-- Use IntermediateOutputDirectory as our Output, and also set BinplaceRoot to the BinariesDirectory.
19 This prevents us publishing a bunch of files we don't really need into the BinariesDirectory,
20 such as extra PDBs, .mt files, etc. See clr.targets for the managed story which works differently.
22 <BinariesDirectory Condition="'$(BinariesSubDirectory)' != ''">$(BinariesDirectory)\$(BinariesSubDirectory)</BinariesDirectory>
23 <OutputPath>$(IntermediateOutputDirectory)\</OutputPath>
24 <BinplaceRoot>$(BinariesDirectory)</BinplaceRoot>
25 <BinplaceSymbols>true</BinplaceSymbols>
26 <OutputLibPath>$(ClrLibPath)</OutputLibPath>
27 <UsePdbToCompile>true</UsePdbToCompile>
28 <UseIncrementalCompiling>true</UseIncrementalCompiling>
29 <RootOutputPath>$(BinariesDirectory)</RootOutputPath>
31 <!-- Tags to detect illegal usage -->
32 <ObjectDirectory>**##ILLEGAL_ ObjectDirectory##**</ObjectDirectory>
33 <ObjectDirectoryPhase0>**##ILLEGAL_ ObjectDirectory0##**</ObjectDirectoryPhase0>
34 <ObjectDirectoryPhase1>**##ILLEGAL_ ObjectDirectory1##**</ObjectDirectoryPhase1>
35 <ObjectDirectoryPhase2>**##ILLEGAL_ ObjectDirectory2##**</ObjectDirectoryPhase2>
38 <!-- Enable this when we're ready to handle P2P -->
39 <BuildProjectReferences>true</BuildProjectReferences>
41 <!-- Use the CLR warning suppression instead of the devdiv one-->
42 <ClEnforceStandardScoping>true</ClEnforceStandardScoping>
43 <ForcedIncludeFiles>WarningControl.h</ForcedIncludeFiles>
45 <ClForcedIncludeFiles>$(ForcedIncludeFiles)</ClForcedIncludeFiles>
46 <Fullcxxeh>Async</Fullcxxeh>
47 <Synccxxeh>Sync</Synccxxeh>
48 <Sehonly>Disabled</Sehonly>
49 <ClNativeExceptionHandling>$(Fullcxxeh)</ClNativeExceptionHandling>
50 <ClExternCNeverThrowsException>false</ClExternCNeverThrowsException>
52 <!-- Use iso volatile semantics for better performance -->
53 <ClIsoVolatile>true</ClIsoVolatile>
55 <!-- Originally, src\tools\I386mk.inc turned FPO off by default because it makes ETW stack crawling bad. -->
58 <!-- Ensure that we're not setting /DNT_UP=1 which disables multiprocessor builds -->
59 <NtUp Condition="'$(NtUp)' == ''">0</NtUp>
61 <ClrBuildError>*** CLR Build Error:</ClrBuildError>
62 <ClrBuildTrace>*** CLR Trace:</ClrBuildTrace>
64 <ClAdditionalOptions Condition="'$(NoClMpFlag)'!='true'">$(ClAdditionalOptions) /MP</ClAdditionalOptions>
65 <ClAdditionalOptions>$(ClAdditionalOptions) /GS /d2Zi+</ClAdditionalOptions>
66 <ClBufferSecurityCheck>true</ClBufferSecurityCheck>
69 <!-- In Dbg and Chk builds, set /homeparams on x64 -->
70 <ClAdditionalOptions Condition="'$(BuildArchitecture)' == 'amd64' and ('$(BuildType)' == 'Checked' or '$(BuildType)' == 'Debug')">$(ClAdditionalOptions) /homeparams</ClAdditionalOptions>
72 <!-- Warning Try not use _BuildArch if is not specific to build system. Cross-compilation requires to make distiction between build arhitecture
73 and target arhitecture.
74 Use _BuildArch only when you need to trigger, use the tools of some arhitecture.
75 Use TargetArch for anything else: feature selection, files selection, etc.
77 <_BuildArch>$(_BUILDARCH)</_BuildArch>
79 <TargetArch Condition="'$(TargetArch)' == '' and '$(CrossTargetArchitecture)'!=''">$(CrossTargetArchitecture)</TargetArch>
80 <TargetArch Condition="'$(TargetArch)' == ''">$(BuildArchitecture)</TargetArch>
82 <TargetArch Condition="'$(TargetArch)'=='AMD64'">amd64</TargetArch>
84 <!-- Enable X86-ARM cross-plat defines -->
85 <CDefines Condition="'$(TargetArch)' == 'i386'">$(CDefines);_TARGET_X86_=1;</CDefines>
86 <CDefines Condition="'$(TargetArch)' == 'amd64'">$(CDefines);_TARGET_AMD64_=1;</CDefines>
87 <CDefines Condition="'$(TargetArch)' == 'arm'">$(CDefines);_TARGET_ARM_=1;</CDefines>
88 <CDefines Condition="'$(TargetArch)' == 'arm64'">$(CDefines);_TARGET_ARM64_=1;</CDefines>
90 <AsmSuffix Condition="'$(BuildArchitecture)' == 'i386' or '$(BuildArchitecture)' == 'amd64'">asm</AsmSuffix>
92 <!-- Note: ClrProduct can be set prior to this file to 'Standalone'. -->
93 <ClrProduct Condition="(('$(BuildProjectName)' == 'CoreCLR' or '$(BuildProjectName)' == 'CoreSys')) and ('$(ClrProduct)' == '' or '$(CoreTarget)' == 'true')">core_clr</ClrProduct>
94 <ClrProduct Condition="('$(BuildProjectName)' == '') and ('$(ClrProduct)' == '')">desktop_clr</ClrProduct>
96 <ClAdditionalOptions>$(ClAdditionalOptions) /Zm200</ClAdditionalOptions>
97 <TargetDefines Condition="'$(BuildArchitecture)'=='i386'">$(BuildArchitecture);_X86_</TargetDefines>
98 <TargetDefines Condition="'$(BuildArchitecture)'=='amd64'">$(BuildArchitecture);_AMD64_;BIT64</TargetDefines>
99 <TargetDefines Condition="'$(BuildArchitecture)'=='arm'">$(BuildArchitecture);_ARM_</TargetDefines>
100 <TargetDefines Condition="'$(BuildArchitecture)'=='arm64'">$(BuildArchitecture);_ARM64_;BIT64</TargetDefines>
102 <TargetCpu Condition="('$(TargetArch)' == 'i386') or ('$(TargetArch)' == 'rotor_x86')">i386</TargetCpu>
103 <TargetCpu Condition="('$(TargetArch)' == 'amd64') or ('$(TargetArch)' == 'rotor_amd64')">amd64</TargetCpu>
104 <TargetCpu Condition="('$(TargetArch)' == 'arm')">arm</TargetCpu>
105 <TargetCpu Condition="('$(TargetArch)' == 'arm64')">arm64</TargetCpu>
107 <GeneratePlacefileFromFilelist>true</GeneratePlacefileFromFilelist>
112 <PropertyGroup Condition="'$(DoPrefastBuild)' == 'true'">
113 <PrefastClToolPath>$(ToolsPath)\$(ToolsArchitecture)\prefast\scripts</PrefastClToolPath>
114 <PrefastClToolExe>prefast.exe $(ClToolPath)\$(ClToolExe)</PrefastClToolExe>
118 <!-- CLR Feature Settings. We set the default values here, allow leaf projects to override, and then
119 set the CDefines based on these properties in clr.targets
121 <Import Project="$(MSBuildThisFileDirectory)clr.desktop.props" />
122 <Import Project="$(MSBuildThisFileDirectory)clr.coreclr.props" />
124 <PropertyGroup Condition="'$(CrossGenCompile)'=='true'">
125 <!-- Override settings of certain features to disable them for crossgen unconditionally -->
126 <!-- If you add new features to this list make sure that they are not affecting codegen or content of datastructures persisted in NGen image -->
127 <EnCSupported>false</EnCSupported>
128 <PerfcountersSupportedBuild>false</PerfcountersSupportedBuild>
129 <FeatureAppXBinder>false</FeatureAppXBinder>
130 <FeatureCasPolicy>false</FeatureCasPolicy>
131 <FeatureEventTrace>false</FeatureEventTrace>
132 <FeatureFusion>false</FeatureFusion>
133 <FeatureIncludeAllInterfaces>false</FeatureIncludeAllInterfaces>
134 <FeatureLoaderOptimization>false</FeatureLoaderOptimization>
135 <FeatureMdaSupported>false</FeatureMdaSupported>
136 <FeatureMergeJitAndEngine>true</FeatureMergeJitAndEngine>
137 <FeatureMulticoreJIT>false</FeatureMulticoreJIT>
138 <FeatureRandomizedStringHashing>false</FeatureRandomizedStringHashing>
139 <FeatureReflectionOnlyLoad>false</FeatureReflectionOnlyLoad>
140 <FeatureStackProbe>false</FeatureStackProbe>
141 <FeatureReJIT>false</FeatureReJIT>
142 <FeaturePls>false</FeaturePls>
143 <FeatureVersioningLog>false</FeatureVersioningLog>
144 <FeatureNativeImageGeneration>true</FeatureNativeImageGeneration>
145 <FeatureReadyToRunCompiler Condition="'$(FeatureReadyToRun)' == 'true'">true</FeatureReadyToRunCompiler>
146 <!-- Turn on MDIL generation support in crossgen for phone -->
147 <MDILGenerator Condition="'$(BuildForCoreSystem)' == 'true' and '$(TargetArch)'=='arm'">true</MDILGenerator>
148 <!-- Link crossgen with static CRT to make it standalone .exe -->
149 <LinkUseCMT>true</LinkUseCMT>
150 <UseMsvcrt>false</UseMsvcrt>
153 <PropertyGroup Condition="'$(ClrProduct)'=='Standalone'">
155 No features enabled by design - turn them on in your project file either:
156 - before including this file, or
157 - after via <ClAdditionalOptions>$(ClAdditionalOptions) -DFEATURE_YourFeatureName</ClAdditionalOptions>.
158 Created primarily for standalone MetaData DLLs for WinRT - file:src\DLLs\StandaloneMD-RO and file:src\DLLs\StandaloneMD-RW
160 By default uses statically linked CRT:
161 <UseMsvcrt>false</UseMsvcrt>
162 <LinkUseCMT>true</LinkUseCMT>
167 <MainClrModuleName Condition="'$(FeatureCoreclr)'=='true'">coreclr</MainClrModuleName>
168 <MainClrModuleName Condition="'$(FeatureCoreclr)'!='true'">clr</MainClrModuleName>
169 <MainDacMouleName Condition="'$(FeatureCoreclr)'=='true'">mscordaccore</MainDacMouleName>
170 <MainDacMouleName Condition="'$(FeatureCoreclr)'!='true'">mscordacwks</MainDacMouleName>
174 <DebugBuild Condition="'$(NTDEBUG)' == '' or '$(NTDEBUG)'=='ntsdnodbg'">false</DebugBuild>
175 <DebugBuild Condition="'$(NTDEBUG)' != '' and '$(NTDEBUG)'!='ntsdnodbg'">true</DebugBuild>
179 <When Condition="$(DebugBuild)">
181 <CDefines>$(CDefines);NTMAKEENV;_DEBUG</CDefines>
182 <DebugCrts>true</DebugCrts>
185 <PropertyGroup Condition="'$(_BUILDOPT)' == 'no opt'">
186 <CDefines>$(CDefines);WRITE_BARRIER_CHECK=1</CDefines>
187 <Optimize>false</Optimize>
192 <CDefines>$(CDefines);NTMAKEENV;NDEBUG;PERF_TRACKING</CDefines>
199 <ClIntrinsicFunctions>true</ClIntrinsicFunctions>
201 <!-- "Disabled"=="/Od" "MinSpace"=="/O1" "MaxSpeed"=="/O2" -->
202 <ClOptimization Condition="'$(_BUILDOPT)' == 'full opt'">MinSpace</ClOptimization>
203 <ClOptimization Condition="'$(_BUILDOPT)' != 'full opt'">Disabled</ClOptimization>
205 <!-- Size == "/Os" Speed == "/Ot" Disabled == "" -->
206 <ClFavorSizeOrSpeed>Disabled</ClFavorSizeOrSpeed>
210 <CDefines>$(CDefines);_BLD_CLR</CDefines>
212 <ClAdditionalOptions>$(ExceptionHandling) $(ClAdditionalOptions) /we4640</ClAdditionalOptions>
214 <!-- Desktop CLR, starting with version 4.5, supports Win2k8 R1 and higher on server, and Win7 and higher on client.
215 So across server & client, 0x0600 is the default minimum required WINVER -->
216 <Win32WinNt>0x0600</Win32WinNt>
218 <!-- CoreSys supports Win8 and higher -->
219 <Win32WinNt Condition="'$(BuildForCoreSystem)' == 'true' and '$(CrossTargetArchitecture)' == ''">0x0602</Win32WinNt>
221 <!-- When building cross-target binaries, they must be able to run on pre-Win8 OS and thus, should have subsystem version 6.00. so, override the Subsystem setting
222 specified in tools\Microsoft.DevDiv.targets.
224 <SubsystemVersion Condition="'$(BuildForCoreSystem)' == 'true' and '$(AllowCrossTargeting)' == 'true'">6.00</SubsystemVersion>
226 <!-- Some special projects under CLR, like clr\src\DLLS\culture\mscorwks\culture.nativeproj and
227 clr\src\DLLS\normalization\mscorwks\normalization.nativeproj need to be compiled with
228 a special WINVER, so respect their requests -->
229 <Win32WinNt Condition="'$(ClrOverriddenWin32WinNt)' != ''">$(ClrOverriddenWin32WinNt)</Win32WinNt>
231 <!-- Now make sure WINVER matches Win32WinNt -->
232 <CDefines Condition="'$(Win32WinNt)' != ''">$(CDefines);WINVER=$(Win32WinNt)</CDefines>
235 <LinkLibIgnore Condition="'$(TargetArch)' == 'i386'">4013</LinkLibIgnore>
236 <ClrBuildLeanAndMean>true</ClrBuildLeanAndMean>
237 <LinkLibIgnore Condition="!('$(TargetArch)' == 'i386')">4197,4013</LinkLibIgnore>
238 <LinkLibIgnore>$(LinkLibIgnore);4254</LinkLibIgnore>
239 <UseVsVersion Condition="'$(UseVsVersion)' == ''">false</UseVsVersion>
240 <LibWarnAsError>true</LibWarnAsError>
242 <CoreSystemSdkPath Condition="'$(TargetArch)' != 'arm64'">$(ExternalAPIsPath)\Win8CoreSystem</CoreSystemSdkPath>
243 <CoreSystemSdkPath Condition="'$(TargetArch)' == 'arm64'">$(ExternalAPIsPath)\Win9CoreSystem</CoreSystemSdkPath>
245 <UserIncludes>$(Clrbase)\src\inc; $(Clrbase)\src\strongname\inc; $(IntraPartitionAPIsPath)\inc; $(UserIncludes); $(ClrIncPath)</UserIncludes>
246 <UserIncludes Condition="'$(BuildForCoreSystem)' != 'true' or '$(CrossTargetArchitecture)' != ''">$(UserIncludes); $(VCToolsIncPath); $(VCPublicIncPath);</UserIncludes>
247 <UserIncludes Condition="'$(BuildForCoreSystem)' == 'true' and '$(CrossTargetArchitecture)' == ''">$(UserIncludes); $(CoreSystemSdkPath)\inc; $(CoreSystemSdkPath)\inc\crt;</UserIncludes>
248 <UserIncludes Condition="'$(UseVsVersion)' == 'false'">$(UserIncludes); $(NdpRootIncPath); $(NDP_CommonIncPath)</UserIncludes>
249 <UserIncludes Condition="'$(FeatureCominterop)' == 'true'">$(Clrbase)\src\inc\WinRT; $(UserIncludes)</UserIncludes>
251 <PogoInstrument>false</PogoInstrument>
252 <PogoOptimize>false</PogoOptimize>
253 <PogoUpdate>false</PogoUpdate>
254 <PogoExePhase>1</PogoExePhase>
256 <ResgenDefines Condition="'$(FeatureImpersonation)' == '1'">$(ResgenDefines) /define:FEATURE_IMPERSONATION</ResgenDefines>
257 <ResgenDefines Condition="'$(FeatureCrypto)' == '1'">$(ResgenDefines) /define:FEATURE_CRYPTO</ResgenDefines>
258 <ResgenDefines Condition="'$(FeatureIsostore)' == '1'">$(ResgenDefines) /define:FEATURE_ISOSTORE</ResgenDefines>
259 <ResgenDefines Condition="'$(FeatureMacl)' == '1'">$(ResgenDefines) /define:FEATURE_MACL</ResgenDefines>
260 <ResgenDefines Condition="'$(FeatureCasPolicy)' == '1'">$(ResgenDefines) /define:FEATURE_CAS_POLICY</ResgenDefines>
261 <ResgenDefines Condition="'$(FeatureRemoting)' == '1'">$(ResgenDefines) /define:FEATURE_REMOTING</ResgenDefines>
262 <ResgenDefines Condition="'$(FeatureSerialization)' == '1'">$(ResgenDefines) /define:FEATURE_SERIALIZATION</ResgenDefines>
263 <ResgenDefines Condition="'$(FeatureIdentityReference)' == '1'">$(ResgenDefines) /define:FEATURE_IDENTITY_REFERENCE</ResgenDefines>
264 <ResgenDefines Condition="'$(FeatureDisplayCultureInfo)' == '1'">$(ResgenDefines) /define:FEATURE_DISPLAY_CULTURE_INFO</ResgenDefines>
265 <ResgenDefines Condition="'$(FeatureDisplayRegionInfo)' == '1'">$(ResgenDefines) /define:FEATURE_DISPLAY_REGION_INFO</ResgenDefines>
267 <RootOutputPath>$(BinariesDirectory)</RootOutputPath>
270 <!-- Explicitly disable UninitializedVariableCheck and StackFrameCheck since the DevDiv targets sets them as default on and it
271 breaks the build when optimizations are enabled
274 <NoBuildTypeDefines>true</NoBuildTypeDefines>
277 The DevDiv targets define these to stuff we don't use if they're left blank and there's no easy way to keep them off
278 of the CL.exe command line.
280 <OakIncPath >.</OakIncPath>
281 <ConfigIncPath >.</ConfigIncPath>
282 <VSCommonIncPath >.</VSCommonIncPath>
284 <!-- Devdiv targets have a slightly different semantics for debug defines like DBG. Defined as
285 BuildType == Debug || BuildType == Checked && DebugBuild == True. In CLR, Checked has DBG
286 defined so we override to preserve ntbuild behaviour
288 <CDefines Condition="'$(BuildType)' == 'Checked' or '$(BuildType)' == 'Debug'">$(CDefines);DBG=1</CDefines>
290 <!-- Note: This defines only name of the lib 'ClrCrtLib'. Project has to use it explicitly like this: <LibCLib>$(ClrCrtLib)</LibCLib> -->
291 <ClrCrtLib Condition="'$(BuildForCoreSystem)' != 'true'">$(CrtLibPath)\msvcrt$(BuildSuffix)_clr.lib</ClrCrtLib>
293 <RefAsmOutputDirectory>$(BinariesDirectory)\ref\</RefAsmOutputDirectory>
297 <PropertyGroup Condition="'$(BuildForCoreSystem)' == 'true' and ('$(HostMachineOS)'=='' or '$(HostMachineOS)' == 'OneCore' or '$(HostMachineOS)'=='OneCoreWin7Compat')">
299 For the most part we build against CoreSystem in the same way as we do against full Windows. But
300 linking is very different. There are a different set of import libraries (in sdk\lib\CoreSystem) and
301 we pick up the system CRT (from sdk rather than vc).
303 There are 3 different variations of linking we might use:
304 CoreSystem forwarder libraries - This links against mincore_fw.lib, which causes the binaries to reference
305 a bunch of small forwarder dlls at runtime. These forwarders redirect CoreSystem api-set imports back
306 to standard win32 API exports. Binaries linked this way can run on any CoreSystem OS + Win7, however
307 all the forwarder dlls must be present on the LoadLibrary search path.
308 CoreSystem stand alone libraries - This links against mincore.lib (and maybe others like mincore_legacy.lib).
309 These binaries can run on OneCore OS or Win8+ and don't have any dependency on forwarders.
310 Win32 APIs - This links against the traditional win32 libraries such as kernel32 and the VC CRT. These
311 binaries run on Win7+ but don't work on pure OneCore SKUs.
313 Most of the binaries we build in the CoreSystem build get linked using the forwarder libraries. To do
314 that we need to set $(BuildForCoreSystem)=true and $(BuildForWindows7)=true. All the binaries in this
315 group have never set the $(HostMachineOS) property. On ARM we don't support win7, so in that case we
316 use the stand alone library linkage, $(BuildForWindows7)=false.
318 Some of the binaries we build are cross compiled, such as some debugging related binaries. In this scenario
319 we are debugging a CoreSystem coreclr, but the debugger may be running on a different machine. Because
320 these libraries can be loaded via LoadLibrary and won't have forwarder libraries available, we use some of
321 the alternate linkages. All binaries in this set have set the $(HostMachineOS) to something...
322 $(HostMachineOS)=='windows' => we want Win32 API and won't enter this conditional
323 $(HostMachineOS)=='OneCore' => we want the stand alone libraries
324 $(HostMachineOS)=='OneCoreWin7Compat' => we want the forwarders
326 <BuildForWindows7 Condition="'$(BuildForWindows7)'==''">true</BuildForWindows7>
327 <BuildForWindows7 Condition="'$(HostMachineOS)'=='OneCore'">false</BuildForWindows7>
328 <BuildForWindows7 Condition="'$(TargetArch)'=='arm' or '$(TargetArch)'=='arm64'">false</BuildForWindows7>
330 <SdkLibPath>$(CoreSystemSdkPath)\sdk\lib\mincore\$(BuildArchitecture)</SdkLibPath>
331 <SdkLibPath Condition="'$(BuildForWindows7)' == 'true'">$(ExternalAPIsPath)\Windows\Win7\$(BuildArchitecture)</SdkLibPath>
333 <CoreSystemCrt>$(SdkLibPath)\msvcrt.lib</CoreSystemCrt>
334 <CrtSecureDeprecate>true</CrtSecureDeprecate>
335 <LinkNoLibraries>true</LinkNoLibraries>
336 <LinkNoWin32Libraries>true</LinkNoWin32Libraries>
337 <NoWinXPSP3NXCompat>true</NoWinXPSP3NXCompat>