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 <CDefines Condition="'$(BuildArchitecture)' == 'amd64' or '$(BuildArchitecture)' == 'arm64'">$(CDefines);BIT64</CDefines>
94 <!-- Note: ClrProduct can be set prior to this file to 'Standalone'. -->
95 <ClrProduct Condition="(('$(BuildProjectName)' == 'CoreCLR' or '$(BuildProjectName)' == 'CoreSys')) and ('$(ClrProduct)' == '' or '$(CoreTarget)' == 'true')">core_clr</ClrProduct>
96 <ClrProduct Condition="('$(BuildProjectName)' == '') and ('$(ClrProduct)' == '')">desktop_clr</ClrProduct>
98 <ClAdditionalOptions>$(ClAdditionalOptions) /Zm200</ClAdditionalOptions>
99 <TargetDefines Condition="'$(BuildArchitecture)'=='i386'">$(BuildArchitecture);_X86_</TargetDefines>
100 <TargetDefines Condition="'$(BuildArchitecture)'=='amd64'">$(BuildArchitecture);_AMD64_</TargetDefines>
101 <TargetDefines Condition="'$(BuildArchitecture)'=='arm'">$(BuildArchitecture);_ARM_</TargetDefines>
102 <TargetDefines Condition="'$(BuildArchitecture)'=='arm64'">$(BuildArchitecture);_ARM64_</TargetDefines>
104 <TargetCpu Condition="('$(TargetArch)' == 'i386')">i386</TargetCpu>
105 <TargetCpu Condition="('$(TargetArch)' == 'amd64')">amd64</TargetCpu>
106 <TargetCpu Condition="('$(TargetArch)' == 'arm')">arm</TargetCpu>
107 <TargetCpu Condition="('$(TargetArch)' == 'arm64')">arm64</TargetCpu>
109 <GeneratePlacefileFromFilelist>true</GeneratePlacefileFromFilelist>
114 <PropertyGroup Condition="'$(DoPrefastBuild)' == 'true'">
115 <PrefastClToolPath>$(ToolsPath)\$(ToolsArchitecture)\prefast\scripts</PrefastClToolPath>
116 <PrefastClToolExe>prefast.exe $(ClToolPath)\$(ClToolExe)</PrefastClToolExe>
120 <!-- CLR Feature Settings. We set the default values here, allow leaf projects to override, and then
121 set the CDefines based on these properties in clr.targets
123 <Import Project="$(MSBuildThisFileDirectory)clr.desktop.props" />
124 <Import Project="$(MSBuildThisFileDirectory)clr.coreclr.props" />
126 <PropertyGroup Condition="'$(CrossGenCompile)'=='true'">
127 <!-- Override settings of certain features to disable them for crossgen unconditionally -->
128 <!-- If you add new features to this list make sure that they are not affecting codegen or content of datastructures persisted in NGen image -->
129 <EnCSupported>false</EnCSupported>
130 <PerfcountersSupportedBuild>false</PerfcountersSupportedBuild>
131 <FeatureAppXBinder>false</FeatureAppXBinder>
132 <FeatureCasPolicy>false</FeatureCasPolicy>
133 <FeatureEventTrace>false</FeatureEventTrace>
134 <FeatureFusion>false</FeatureFusion>
135 <FeatureIncludeAllInterfaces>false</FeatureIncludeAllInterfaces>
136 <FeatureLoaderOptimization>false</FeatureLoaderOptimization>
137 <FeatureMdaSupported>false</FeatureMdaSupported>
138 <FeatureMergeJitAndEngine>true</FeatureMergeJitAndEngine>
139 <FeatureMulticoreJIT>false</FeatureMulticoreJIT>
140 <FeatureRandomizedStringHashing>false</FeatureRandomizedStringHashing>
141 <FeatureReflectionOnlyLoad>false</FeatureReflectionOnlyLoad>
142 <FeatureStackProbe>false</FeatureStackProbe>
143 <FeatureReJIT>false</FeatureReJIT>
144 <FeaturePls>false</FeaturePls>
145 <FeatureVersioningLog>false</FeatureVersioningLog>
146 <FeatureNativeImageGeneration>true</FeatureNativeImageGeneration>
147 <FeatureReadyToRunCompiler Condition="'$(FeatureReadyToRun)' == 'true'">true</FeatureReadyToRunCompiler>
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 <Optimize>false</Optimize>
191 <CDefines>$(CDefines);NTMAKEENV;NDEBUG;PERF_TRACKING</CDefines>
198 <ClIntrinsicFunctions>true</ClIntrinsicFunctions>
200 <!-- "Disabled"=="/Od" "MinSpace"=="/O1" "MaxSpeed"=="/O2" -->
201 <ClOptimization Condition="'$(_BUILDOPT)' == 'full opt'">MinSpace</ClOptimization>
202 <ClOptimization Condition="'$(_BUILDOPT)' != 'full opt'">Disabled</ClOptimization>
204 <!-- Size == "/Os" Speed == "/Ot" Disabled == "" -->
205 <ClFavorSizeOrSpeed>Disabled</ClFavorSizeOrSpeed>
209 <CDefines>$(CDefines);_BLD_CLR</CDefines>
211 <ClAdditionalOptions>$(ExceptionHandling) $(ClAdditionalOptions) /we4640</ClAdditionalOptions>
213 <!-- Desktop CLR, starting with version 4.5, supports Win2k8 R1 and higher on server, and Win7 and higher on client.
214 So across server & client, 0x0600 is the default minimum required WINVER -->
215 <Win32WinNt>0x0600</Win32WinNt>
217 <!-- CoreSys supports Win8 and higher -->
218 <Win32WinNt Condition="'$(BuildForCoreSystem)' == 'true' and '$(CrossTargetArchitecture)' == ''">0x0602</Win32WinNt>
220 <!-- 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
221 specified in tools\Microsoft.DevDiv.targets.
223 <SubsystemVersion Condition="'$(BuildForCoreSystem)' == 'true' and '$(AllowCrossTargeting)' == 'true'">6.00</SubsystemVersion>
225 <!-- Some special projects under CLR, like clr\src\DLLS\culture\mscorwks\culture.nativeproj and
226 clr\src\DLLS\normalization\mscorwks\normalization.nativeproj need to be compiled with
227 a special WINVER, so respect their requests -->
228 <Win32WinNt Condition="'$(ClrOverriddenWin32WinNt)' != ''">$(ClrOverriddenWin32WinNt)</Win32WinNt>
230 <!-- Now make sure WINVER matches Win32WinNt -->
231 <CDefines Condition="'$(Win32WinNt)' != ''">$(CDefines);WINVER=$(Win32WinNt)</CDefines>
234 <LinkLibIgnore Condition="'$(TargetArch)' == 'i386'">4013</LinkLibIgnore>
235 <ClrBuildLeanAndMean>true</ClrBuildLeanAndMean>
236 <LinkLibIgnore Condition="!('$(TargetArch)' == 'i386')">4197,4013</LinkLibIgnore>
237 <LinkLibIgnore>$(LinkLibIgnore);4254</LinkLibIgnore>
238 <UseVsVersion Condition="'$(UseVsVersion)' == ''">false</UseVsVersion>
239 <LibWarnAsError>true</LibWarnAsError>
241 <CoreSystemSdkPath Condition="'$(TargetArch)' != 'arm64'">$(ExternalAPIsPath)\Win8CoreSystem</CoreSystemSdkPath>
242 <CoreSystemSdkPath Condition="'$(TargetArch)' == 'arm64'">$(ExternalAPIsPath)\Win9CoreSystem</CoreSystemSdkPath>
244 <UserIncludes>$(Clrbase)\src\inc; $(Clrbase)\src\strongname\inc; $(IntraPartitionAPIsPath)\inc; $(UserIncludes); $(ClrIncPath)</UserIncludes>
245 <UserIncludes Condition="'$(BuildForCoreSystem)' != 'true' or '$(CrossTargetArchitecture)' != ''">$(UserIncludes); $(VCToolsIncPath); $(VCPublicIncPath);</UserIncludes>
246 <UserIncludes Condition="'$(BuildForCoreSystem)' == 'true' and '$(CrossTargetArchitecture)' == ''">$(UserIncludes); $(CoreSystemSdkPath)\inc; $(CoreSystemSdkPath)\inc\crt;</UserIncludes>
247 <UserIncludes Condition="'$(UseVsVersion)' == 'false'">$(UserIncludes); $(NdpRootIncPath); $(NDP_CommonIncPath)</UserIncludes>
248 <UserIncludes Condition="'$(FeatureCominterop)' == 'true'">$(Clrbase)\src\inc\WinRT; $(UserIncludes)</UserIncludes>
250 <PogoInstrument>false</PogoInstrument>
251 <PogoOptimize>false</PogoOptimize>
252 <PogoUpdate>false</PogoUpdate>
253 <PogoExePhase>1</PogoExePhase>
255 <ResgenDefines Condition="'$(FeatureImpersonation)' == '1'">$(ResgenDefines) /define:FEATURE_IMPERSONATION</ResgenDefines>
256 <ResgenDefines Condition="'$(FeatureCrypto)' == '1'">$(ResgenDefines) /define:FEATURE_CRYPTO</ResgenDefines>
257 <ResgenDefines Condition="'$(FeatureIsostore)' == '1'">$(ResgenDefines) /define:FEATURE_ISOSTORE</ResgenDefines>
258 <ResgenDefines Condition="'$(FeatureMacl)' == '1'">$(ResgenDefines) /define:FEATURE_MACL</ResgenDefines>
259 <ResgenDefines Condition="'$(FeatureCasPolicy)' == '1'">$(ResgenDefines) /define:FEATURE_CAS_POLICY</ResgenDefines>
260 <ResgenDefines Condition="'$(FeatureRemoting)' == '1'">$(ResgenDefines) /define:FEATURE_REMOTING</ResgenDefines>
261 <ResgenDefines Condition="'$(FeatureSerialization)' == '1'">$(ResgenDefines) /define:FEATURE_SERIALIZATION</ResgenDefines>
262 <ResgenDefines Condition="'$(FeatureIdentityReference)' == '1'">$(ResgenDefines) /define:FEATURE_IDENTITY_REFERENCE</ResgenDefines>
263 <ResgenDefines Condition="'$(FeatureDisplayCultureInfo)' == '1'">$(ResgenDefines) /define:FEATURE_DISPLAY_CULTURE_INFO</ResgenDefines>
264 <ResgenDefines Condition="'$(FeatureDisplayRegionInfo)' == '1'">$(ResgenDefines) /define:FEATURE_DISPLAY_REGION_INFO</ResgenDefines>
266 <RootOutputPath>$(BinariesDirectory)</RootOutputPath>
269 <!-- Explicitly disable UninitializedVariableCheck and StackFrameCheck since the DevDiv targets sets them as default on and it
270 breaks the build when optimizations are enabled
273 <NoBuildTypeDefines>true</NoBuildTypeDefines>
276 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
277 of the CL.exe command line.
279 <OakIncPath >.</OakIncPath>
280 <ConfigIncPath >.</ConfigIncPath>
281 <VSCommonIncPath >.</VSCommonIncPath>
283 <!-- Devdiv targets have a slightly different semantics for debug defines like DBG. Defined as
284 BuildType == Debug || BuildType == Checked && DebugBuild == True. In CLR, Checked has DBG
285 defined so we override to preserve ntbuild behaviour
287 <CDefines Condition="'$(BuildType)' == 'Checked' or '$(BuildType)' == 'Debug'">$(CDefines);DBG=1</CDefines>
289 <!-- Note: This defines only name of the lib 'ClrCrtLib'. Project has to use it explicitly like this: <LibCLib>$(ClrCrtLib)</LibCLib> -->
290 <ClrCrtLib Condition="'$(BuildForCoreSystem)' != 'true'">$(CrtLibPath)\msvcrt$(BuildSuffix)_clr.lib</ClrCrtLib>
292 <RefAsmOutputDirectory>$(BinariesDirectory)\ref\</RefAsmOutputDirectory>
296 <PropertyGroup Condition="'$(BuildForCoreSystem)' == 'true' and ('$(HostMachineOS)'=='' or '$(HostMachineOS)' == 'OneCore' or '$(HostMachineOS)'=='OneCoreWin7Compat')">
298 For the most part we build against CoreSystem in the same way as we do against full Windows. But
299 linking is very different. There are a different set of import libraries (in sdk\lib\CoreSystem) and
300 we pick up the system CRT (from sdk rather than vc).
302 There are 3 different variations of linking we might use:
303 CoreSystem forwarder libraries - This links against mincore_fw.lib, which causes the binaries to reference
304 a bunch of small forwarder dlls at runtime. These forwarders redirect CoreSystem api-set imports back
305 to standard win32 API exports. Binaries linked this way can run on any CoreSystem OS + Win7, however
306 all the forwarder dlls must be present on the LoadLibrary search path.
307 CoreSystem stand alone libraries - This links against mincore.lib (and maybe others like mincore_legacy.lib).
308 These binaries can run on OneCore OS or Win8+ and don't have any dependency on forwarders.
309 Win32 APIs - This links against the traditional win32 libraries such as kernel32 and the VC CRT. These
310 binaries run on Win7+ but don't work on pure OneCore SKUs.
312 Most of the binaries we build in the CoreSystem build get linked using the forwarder libraries. To do
313 that we need to set $(BuildForCoreSystem)=true and $(BuildForWindows7)=true. All the binaries in this
314 group have never set the $(HostMachineOS) property. On ARM we don't support win7, so in that case we
315 use the stand alone library linkage, $(BuildForWindows7)=false.
317 Some of the binaries we build are cross compiled, such as some debugging related binaries. In this scenario
318 we are debugging a CoreSystem coreclr, but the debugger may be running on a different machine. Because
319 these libraries can be loaded via LoadLibrary and won't have forwarder libraries available, we use some of
320 the alternate linkages. All binaries in this set have set the $(HostMachineOS) to something...
321 $(HostMachineOS)=='windows' => we want Win32 API and won't enter this conditional
322 $(HostMachineOS)=='OneCore' => we want the stand alone libraries
323 $(HostMachineOS)=='OneCoreWin7Compat' => we want the forwarders
325 <BuildForWindows7 Condition="'$(BuildForWindows7)'==''">true</BuildForWindows7>
326 <BuildForWindows7 Condition="'$(HostMachineOS)'=='OneCore'">false</BuildForWindows7>
327 <BuildForWindows7 Condition="'$(TargetArch)'=='arm' or '$(TargetArch)'=='arm64'">false</BuildForWindows7>
329 <SdkLibPath>$(CoreSystemSdkPath)\sdk\lib\mincore\$(BuildArchitecture)</SdkLibPath>
330 <SdkLibPath Condition="'$(BuildForWindows7)' == 'true'">$(ExternalAPIsPath)\Windows\Win7\$(BuildArchitecture)</SdkLibPath>
332 <CoreSystemCrt>$(SdkLibPath)\msvcrt.lib</CoreSystemCrt>
333 <CrtSecureDeprecate>true</CrtSecureDeprecate>
334 <LinkNoLibraries>true</LinkNoLibraries>
335 <LinkNoWin32Libraries>true</LinkNoWin32Libraries>
336 <NoWinXPSP3NXCompat>true</NoWinXPSP3NXCompat>