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>
97 <ClAdditionalOptions>$(ClAdditionalOptions) /Zm200</ClAdditionalOptions>
98 <TargetDefines Condition="'$(BuildArchitecture)'=='i386'">$(BuildArchitecture);_X86_</TargetDefines>
99 <TargetDefines Condition="'$(BuildArchitecture)'=='amd64'">$(BuildArchitecture);_AMD64_</TargetDefines>
100 <TargetDefines Condition="'$(BuildArchitecture)'=='arm'">$(BuildArchitecture);_ARM_</TargetDefines>
101 <TargetDefines Condition="'$(BuildArchitecture)'=='arm64'">$(BuildArchitecture);_ARM64_</TargetDefines>
103 <TargetCpu Condition="('$(TargetArch)' == 'i386')">i386</TargetCpu>
104 <TargetCpu Condition="('$(TargetArch)' == 'amd64')">amd64</TargetCpu>
105 <TargetCpu Condition="('$(TargetArch)' == 'arm')">arm</TargetCpu>
106 <TargetCpu Condition="('$(TargetArch)' == 'arm64')">arm64</TargetCpu>
108 <GeneratePlacefileFromFilelist>true</GeneratePlacefileFromFilelist>
113 <PropertyGroup Condition="'$(DoPrefastBuild)' == 'true'">
114 <PrefastClToolPath>$(ToolsPath)\$(ToolsArchitecture)\prefast\scripts</PrefastClToolPath>
115 <PrefastClToolExe>prefast.exe $(ClToolPath)\$(ClToolExe)</PrefastClToolExe>
119 <!-- CLR Feature Settings. We set the default values here, allow leaf projects to override, and then
120 set the CDefines based on these properties in clr.targets
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 <FeatureCasPolicy>false</FeatureCasPolicy>
130 <FeatureEventTrace>false</FeatureEventTrace>
131 <FeatureFusion>false</FeatureFusion>
132 <FeatureIncludeAllInterfaces>false</FeatureIncludeAllInterfaces>
133 <FeatureMdaSupported>false</FeatureMdaSupported>
134 <FeatureMergeJitAndEngine>true</FeatureMergeJitAndEngine>
135 <FeatureRandomizedStringHashing>false</FeatureRandomizedStringHashing>
136 <FeatureReflectionOnlyLoad>false</FeatureReflectionOnlyLoad>
137 <FeatureStackProbe>false</FeatureStackProbe>
138 <FeatureReJIT>false</FeatureReJIT>
139 <FeatureVersioningLog>false</FeatureVersioningLog>
140 <FeatureNativeImageGeneration>true</FeatureNativeImageGeneration>
141 <FeatureReadyToRunCompiler Condition="'$(FeatureReadyToRun)' == 'true'">true</FeatureReadyToRunCompiler>
142 <!-- Link crossgen with static CRT to make it standalone .exe -->
143 <LinkUseCMT>true</LinkUseCMT>
144 <UseMsvcrt>false</UseMsvcrt>
147 <PropertyGroup Condition="'$(ClrProduct)'=='Standalone'">
149 No features enabled by design - turn them on in your project file either:
150 - before including this file, or
151 - after via <ClAdditionalOptions>$(ClAdditionalOptions) -DFEATURE_YourFeatureName</ClAdditionalOptions>.
152 Created primarily for standalone MetaData DLLs for WinRT - file:src\DLLs\StandaloneMD-RO and file:src\DLLs\StandaloneMD-RW
154 By default uses statically linked CRT:
155 <UseMsvcrt>false</UseMsvcrt>
156 <LinkUseCMT>true</LinkUseCMT>
161 <DebugBuild Condition="'$(NTDEBUG)' == '' or '$(NTDEBUG)'=='ntsdnodbg'">false</DebugBuild>
162 <DebugBuild Condition="'$(NTDEBUG)' != '' and '$(NTDEBUG)'!='ntsdnodbg'">true</DebugBuild>
166 <When Condition="$(DebugBuild)">
168 <CDefines>$(CDefines);NTMAKEENV;_DEBUG</CDefines>
169 <DebugCrts>true</DebugCrts>
172 <PropertyGroup Condition="'$(_BUILDOPT)' == 'no opt'">
173 <Optimize>false</Optimize>
178 <CDefines>$(CDefines);NTMAKEENV;NDEBUG;PERF_TRACKING</CDefines>
185 <ClIntrinsicFunctions>true</ClIntrinsicFunctions>
187 <!-- "Disabled"=="/Od" "MinSpace"=="/O1" "MaxSpeed"=="/O2" -->
188 <ClOptimization Condition="'$(_BUILDOPT)' == 'full opt'">MinSpace</ClOptimization>
189 <ClOptimization Condition="'$(_BUILDOPT)' != 'full opt'">Disabled</ClOptimization>
191 <!-- Size == "/Os" Speed == "/Ot" Disabled == "" -->
192 <ClFavorSizeOrSpeed>Disabled</ClFavorSizeOrSpeed>
196 <CDefines>$(CDefines);_BLD_CLR</CDefines>
198 <ClAdditionalOptions>$(ExceptionHandling) $(ClAdditionalOptions) /we4640</ClAdditionalOptions>
200 <!-- Desktop CLR, starting with version 4.5, supports Win2k8 R1 and higher on server, and Win7 and higher on client.
201 So across server & client, 0x0600 is the default minimum required WINVER -->
202 <Win32WinNt>0x0600</Win32WinNt>
204 <!-- CoreSys supports Win8 and higher -->
205 <Win32WinNt Condition="'$(BuildForCoreSystem)' == 'true' and '$(CrossTargetArchitecture)' == ''">0x0602</Win32WinNt>
207 <!-- 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
208 specified in tools\Microsoft.DevDiv.targets.
210 <SubsystemVersion Condition="'$(BuildForCoreSystem)' == 'true' and '$(AllowCrossTargeting)' == 'true'">6.00</SubsystemVersion>
212 <!-- Some special projects under CLR, like clr\src\DLLS\culture\mscorwks\culture.nativeproj and
213 clr\src\DLLS\normalization\mscorwks\normalization.nativeproj need to be compiled with
214 a special WINVER, so respect their requests -->
215 <Win32WinNt Condition="'$(ClrOverriddenWin32WinNt)' != ''">$(ClrOverriddenWin32WinNt)</Win32WinNt>
217 <!-- Now make sure WINVER matches Win32WinNt -->
218 <CDefines Condition="'$(Win32WinNt)' != ''">$(CDefines);WINVER=$(Win32WinNt)</CDefines>
221 <LinkLibIgnore Condition="'$(TargetArch)' == 'i386'">4013</LinkLibIgnore>
222 <ClrBuildLeanAndMean>true</ClrBuildLeanAndMean>
223 <LinkLibIgnore Condition="!('$(TargetArch)' == 'i386')">4197,4013</LinkLibIgnore>
224 <LinkLibIgnore>$(LinkLibIgnore);4254</LinkLibIgnore>
225 <UseVsVersion Condition="'$(UseVsVersion)' == ''">false</UseVsVersion>
226 <LibWarnAsError>true</LibWarnAsError>
228 <CoreSystemSdkPath Condition="'$(TargetArch)' != 'arm64'">$(ExternalAPIsPath)\Win8CoreSystem</CoreSystemSdkPath>
229 <CoreSystemSdkPath Condition="'$(TargetArch)' == 'arm64'">$(ExternalAPIsPath)\Win9CoreSystem</CoreSystemSdkPath>
231 <UserIncludes>$(Clrbase)\src\inc; $(Clrbase)\src\strongname\inc; $(IntraPartitionAPIsPath)\inc; $(UserIncludes); $(ClrIncPath)</UserIncludes>
232 <UserIncludes Condition="'$(BuildForCoreSystem)' != 'true' or '$(CrossTargetArchitecture)' != ''">$(UserIncludes); $(VCToolsIncPath); $(VCPublicIncPath);</UserIncludes>
233 <UserIncludes Condition="'$(BuildForCoreSystem)' == 'true' and '$(CrossTargetArchitecture)' == ''">$(UserIncludes); $(CoreSystemSdkPath)\inc; $(CoreSystemSdkPath)\inc\crt;</UserIncludes>
234 <UserIncludes Condition="'$(UseVsVersion)' == 'false'">$(UserIncludes); $(NdpRootIncPath); $(NDP_CommonIncPath)</UserIncludes>
235 <UserIncludes Condition="'$(FeatureCominterop)' == 'true'">$(Clrbase)\src\inc\WinRT; $(UserIncludes)</UserIncludes>
237 <PogoInstrument>false</PogoInstrument>
238 <PogoOptimize>false</PogoOptimize>
239 <PogoUpdate>false</PogoUpdate>
240 <PogoExePhase>1</PogoExePhase>
242 <ResgenDefines Condition="'$(FeatureImpersonation)' == '1'">$(ResgenDefines) /define:FEATURE_IMPERSONATION</ResgenDefines>
243 <ResgenDefines Condition="'$(FeatureIsostore)' == '1'">$(ResgenDefines) /define:FEATURE_ISOSTORE</ResgenDefines>
244 <ResgenDefines Condition="'$(FeatureMacl)' == '1'">$(ResgenDefines) /define:FEATURE_MACL</ResgenDefines>
245 <ResgenDefines Condition="'$(FeatureCasPolicy)' == '1'">$(ResgenDefines) /define:FEATURE_CAS_POLICY</ResgenDefines>
246 <ResgenDefines Condition="'$(FeatureRemoting)' == '1'">$(ResgenDefines) /define:FEATURE_REMOTING</ResgenDefines>
247 <ResgenDefines Condition="'$(FeatureIdentityReference)' == '1'">$(ResgenDefines) /define:FEATURE_IDENTITY_REFERENCE</ResgenDefines>
248 <ResgenDefines Condition="'$(FeatureDisplayCultureInfo)' == '1'">$(ResgenDefines) /define:FEATURE_DISPLAY_CULTURE_INFO</ResgenDefines>
249 <ResgenDefines Condition="'$(FeatureDisplayRegionInfo)' == '1'">$(ResgenDefines) /define:FEATURE_DISPLAY_REGION_INFO</ResgenDefines>
251 <RootOutputPath>$(BinariesDirectory)</RootOutputPath>
254 <!-- Explicitly disable UninitializedVariableCheck and StackFrameCheck since the DevDiv targets sets them as default on and it
255 breaks the build when optimizations are enabled
258 <NoBuildTypeDefines>true</NoBuildTypeDefines>
261 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
262 of the CL.exe command line.
264 <OakIncPath >.</OakIncPath>
265 <ConfigIncPath >.</ConfigIncPath>
266 <VSCommonIncPath >.</VSCommonIncPath>
268 <!-- Devdiv targets have a slightly different semantics for debug defines like DBG. Defined as
269 BuildType == Debug || BuildType == Checked && DebugBuild == True. In CLR, Checked has DBG
270 defined so we override to preserve ntbuild behaviour
272 <CDefines Condition="'$(BuildType)' == 'Checked' or '$(BuildType)' == 'Debug'">$(CDefines);DBG=1</CDefines>
274 <!-- Note: This defines only name of the lib 'ClrCrtLib'. Project has to use it explicitly like this: <LibCLib>$(ClrCrtLib)</LibCLib> -->
275 <ClrCrtLib Condition="'$(BuildForCoreSystem)' != 'true'">$(CrtLibPath)\msvcrt$(BuildSuffix)_clr.lib</ClrCrtLib>
277 <RefAsmOutputDirectory>$(BinariesDirectory)\ref\</RefAsmOutputDirectory>
281 <PropertyGroup Condition="'$(BuildForCoreSystem)' == 'true' and ('$(HostMachineOS)'=='' or '$(HostMachineOS)' == 'OneCore' or '$(HostMachineOS)'=='OneCoreWin7Compat')">
283 For the most part we build against CoreSystem in the same way as we do against full Windows. But
284 linking is very different. There are a different set of import libraries (in sdk\lib\CoreSystem) and
285 we pick up the system CRT (from sdk rather than vc).
287 There are 3 different variations of linking we might use:
288 CoreSystem forwarder libraries - This links against mincore_fw.lib, which causes the binaries to reference
289 a bunch of small forwarder dlls at runtime. These forwarders redirect CoreSystem api-set imports back
290 to standard win32 API exports. Binaries linked this way can run on any CoreSystem OS + Win7, however
291 all the forwarder dlls must be present on the LoadLibrary search path.
292 CoreSystem stand alone libraries - This links against mincore.lib (and maybe others like mincore_legacy.lib).
293 These binaries can run on OneCore OS or Win8+ and don't have any dependency on forwarders.
294 Win32 APIs - This links against the traditional win32 libraries such as kernel32 and the VC CRT. These
295 binaries run on Win7+ but don't work on pure OneCore SKUs.
297 Most of the binaries we build in the CoreSystem build get linked using the forwarder libraries. To do
298 that we need to set $(BuildForCoreSystem)=true and $(BuildForWindows7)=true. All the binaries in this
299 group have never set the $(HostMachineOS) property. On ARM we don't support win7, so in that case we
300 use the stand alone library linkage, $(BuildForWindows7)=false.
302 Some of the binaries we build are cross compiled, such as some debugging related binaries. In this scenario
303 we are debugging a CoreSystem coreclr, but the debugger may be running on a different machine. Because
304 these libraries can be loaded via LoadLibrary and won't have forwarder libraries available, we use some of
305 the alternate linkages. All binaries in this set have set the $(HostMachineOS) to something...
306 $(HostMachineOS)=='windows' => we want Win32 API and won't enter this conditional
307 $(HostMachineOS)=='OneCore' => we want the stand alone libraries
308 $(HostMachineOS)=='OneCoreWin7Compat' => we want the forwarders
310 <BuildForWindows7 Condition="'$(BuildForWindows7)'==''">true</BuildForWindows7>
311 <BuildForWindows7 Condition="'$(HostMachineOS)'=='OneCore'">false</BuildForWindows7>
312 <BuildForWindows7 Condition="'$(TargetArch)'=='arm' or '$(TargetArch)'=='arm64'">false</BuildForWindows7>
314 <SdkLibPath>$(CoreSystemSdkPath)\sdk\lib\mincore\$(BuildArchitecture)</SdkLibPath>
315 <SdkLibPath Condition="'$(BuildForWindows7)' == 'true'">$(ExternalAPIsPath)\Windows\Win7\$(BuildArchitecture)</SdkLibPath>
317 <CoreSystemCrt>$(SdkLibPath)\msvcrt.lib</CoreSystemCrt>
318 <CrtSecureDeprecate>true</CrtSecureDeprecate>
319 <LinkNoLibraries>true</LinkNoLibraries>
320 <LinkNoWin32Libraries>true</LinkNoWin32Libraries>
321 <NoWinXPSP3NXCompat>true</NoWinXPSP3NXCompat>