Merge pull request #9152 from wtgodbe/SpeedUpSync
[platform/upstream/coreclr.git] / clr.props
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" />
8
9   <!--Leaf project Properties-->
10   <PropertyGroup>
11     <Clrbase>$(_NTDRIVE)$(_NTROOT)\ndp\clr</Clrbase>
12     <ClrSrcDirectory>$(Clrbase)\src\</ClrSrcDirectory>
13
14     <ClrLibDest Condition="('$(BuildProjectName)' == '')">$(IntraPartitionAPIsPath)\$(LibSubPath)</ClrLibDest>
15     <ClrLibDest Condition="('$(BuildProjectName)' == 'CoreCLR' or '$(BuildProjectName)' == 'CoreSys')">$(IntraPartitionAPIsPath)\CORElib\$(InterApiType)\$(RealBuildArchitecture)</ClrLibDest>
16     <ClrLibPath>$(ClrLibDest)</ClrLibPath>
17     
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.
21     -->
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>
30
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>
36
37
38     <!-- Enable this when we're ready to handle P2P -->
39     <BuildProjectReferences>true</BuildProjectReferences>
40
41     <!-- Use the CLR warning suppression instead of the devdiv one-->
42     <ClEnforceStandardScoping>true</ClEnforceStandardScoping>
43     <ForcedIncludeFiles>WarningControl.h</ForcedIncludeFiles>
44     
45     <ClForcedIncludeFiles>$(ForcedIncludeFiles)</ClForcedIncludeFiles>
46     <Fullcxxeh>Async</Fullcxxeh>
47     <Synccxxeh>Sync</Synccxxeh>
48     <Sehonly>Disabled</Sehonly>
49     <ClNativeExceptionHandling>$(Fullcxxeh)</ClNativeExceptionHandling>
50     <ClExternCNeverThrowsException>false</ClExternCNeverThrowsException>
51
52     <!-- Use iso volatile semantics for better performance -->
53     <ClIsoVolatile>true</ClIsoVolatile>
54
55     <!-- Originally, src\tools\I386mk.inc turned FPO off by default because it makes ETW stack crawling bad.  -->
56     <Fpo>0</Fpo>
57
58     <!-- Ensure that we're not setting /DNT_UP=1 which disables multiprocessor builds -->
59     <NtUp Condition="'$(NtUp)' == ''">0</NtUp>
60
61     <ClrBuildError>*** CLR Build Error:</ClrBuildError>
62     <ClrBuildTrace>*** CLR Trace:</ClrBuildTrace>
63
64     <ClAdditionalOptions Condition="'$(NoClMpFlag)'!='true'">$(ClAdditionalOptions) /MP</ClAdditionalOptions>
65     <ClAdditionalOptions>$(ClAdditionalOptions) /GS /d2Zi+</ClAdditionalOptions>
66     <ClBufferSecurityCheck>true</ClBufferSecurityCheck>
67     
68          
69     <!-- In Dbg and Chk builds, set /homeparams on x64 -->
70     <ClAdditionalOptions Condition="'$(BuildArchitecture)' == 'amd64' and ('$(BuildType)' == 'Checked' or '$(BuildType)' == 'Debug')">$(ClAdditionalOptions) /homeparams</ClAdditionalOptions>
71     
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.
76     -->
77     <_BuildArch>$(_BUILDARCH)</_BuildArch>
78
79     <TargetArch Condition="'$(TargetArch)' == '' and '$(CrossTargetArchitecture)'!=''">$(CrossTargetArchitecture)</TargetArch>
80     <TargetArch Condition="'$(TargetArch)' == ''">$(BuildArchitecture)</TargetArch>
81
82     <TargetArch Condition="'$(TargetArch)'=='AMD64'">amd64</TargetArch>
83     
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>
89
90     <AsmSuffix Condition="'$(BuildArchitecture)' == 'i386' or '$(BuildArchitecture)' == 'amd64'">asm</AsmSuffix>
91
92     <CDefines Condition="'$(BuildArchitecture)' == 'amd64' or '$(BuildArchitecture)' == 'arm64'">$(CDefines);BIT64</CDefines>
93
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
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>
102
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>
107     
108     <GeneratePlacefileFromFilelist>true</GeneratePlacefileFromFilelist>
109     
110   </PropertyGroup>
111
112
113   <PropertyGroup Condition="'$(DoPrefastBuild)' == 'true'">
114     <PrefastClToolPath>$(ToolsPath)\$(ToolsArchitecture)\prefast\scripts</PrefastClToolPath>
115     <PrefastClToolExe>prefast.exe $(ClToolPath)\$(ClToolExe)</PrefastClToolExe>
116   </PropertyGroup>
117
118
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
121   -->
122   <Import Project="$(MSBuildThisFileDirectory)clr.coreclr.props" />
123
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>
145   </PropertyGroup>
146
147   <PropertyGroup Condition="'$(ClrProduct)'=='Standalone'">
148     <!--
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
153         
154         By default uses statically linked CRT:
155             <UseMsvcrt>false</UseMsvcrt>
156             <LinkUseCMT>true</LinkUseCMT>
157     -->
158   </PropertyGroup>
159  
160   <PropertyGroup>
161     <DebugBuild Condition="'$(NTDEBUG)' == '' or '$(NTDEBUG)'=='ntsdnodbg'">false</DebugBuild>
162     <DebugBuild Condition="'$(NTDEBUG)' != '' and '$(NTDEBUG)'!='ntsdnodbg'">true</DebugBuild>
163   </PropertyGroup>
164   
165   <Choose>
166     <When Condition="$(DebugBuild)">
167       <PropertyGroup>
168         <CDefines>$(CDefines);NTMAKEENV;_DEBUG</CDefines>
169         <DebugCrts>true</DebugCrts>
170       </PropertyGroup>
171       
172       <PropertyGroup Condition="'$(_BUILDOPT)' == 'no opt'">
173         <Optimize>false</Optimize> 
174       </PropertyGroup>
175     </When>
176     <Otherwise>
177       <PropertyGroup>
178         <CDefines>$(CDefines);NTMAKEENV;NDEBUG;PERF_TRACKING</CDefines> 
179       </PropertyGroup>
180     </Otherwise>
181   </Choose>
182
183   <PropertyGroup>
184     <!--  "/Oi"  --> 
185     <ClIntrinsicFunctions>true</ClIntrinsicFunctions> 
186
187     <!-- "Disabled"=="/Od" "MinSpace"=="/O1" "MaxSpeed"=="/O2"  --> 
188     <ClOptimization Condition="'$(_BUILDOPT)' == 'full opt'">MinSpace</ClOptimization>
189     <ClOptimization Condition="'$(_BUILDOPT)' != 'full opt'">Disabled</ClOptimization>
190
191     <!-- Size == "/Os"  Speed == "/Ot" Disabled == "" --> 
192     <ClFavorSizeOrSpeed>Disabled</ClFavorSizeOrSpeed>
193   </PropertyGroup>
194   
195   <PropertyGroup>
196     <CDefines>$(CDefines);_BLD_CLR</CDefines> 
197
198     <ClAdditionalOptions>$(ExceptionHandling) $(ClAdditionalOptions) /we4640</ClAdditionalOptions> 
199
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>
203
204     <!-- CoreSys supports Win8 and higher -->
205     <Win32WinNt Condition="'$(BuildForCoreSystem)' == 'true' and '$(CrossTargetArchitecture)' == ''">0x0602</Win32WinNt>
206
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.
209     -->
210     <SubsystemVersion Condition="'$(BuildForCoreSystem)' == 'true' and '$(AllowCrossTargeting)' == 'true'">6.00</SubsystemVersion>
211     
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>
216     
217     <!-- Now make sure WINVER matches Win32WinNt -->
218     <CDefines Condition="'$(Win32WinNt)' != ''">$(CDefines);WINVER=$(Win32WinNt)</CDefines>
219
220
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>
227
228     <CoreSystemSdkPath Condition="'$(TargetArch)' != 'arm64'">$(ExternalAPIsPath)\Win8CoreSystem</CoreSystemSdkPath>
229     <CoreSystemSdkPath Condition="'$(TargetArch)' == 'arm64'">$(ExternalAPIsPath)\Win9CoreSystem</CoreSystemSdkPath>
230     
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>
236
237     <PogoInstrument>false</PogoInstrument> 
238     <PogoOptimize>false</PogoOptimize> 
239     <PogoUpdate>false</PogoUpdate> 
240     <PogoExePhase>1</PogoExePhase>
241     
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> 
250
251     <RootOutputPath>$(BinariesDirectory)</RootOutputPath>
252
253
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
256     -->
257     <NoRtc>true</NoRtc>
258     <NoBuildTypeDefines>true</NoBuildTypeDefines>
259
260     <!-- 
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.   
263     -->
264     <OakIncPath >.</OakIncPath>
265     <ConfigIncPath >.</ConfigIncPath>
266     <VSCommonIncPath >.</VSCommonIncPath>
267     
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
271     -->
272     <CDefines Condition="'$(BuildType)' == 'Checked' or '$(BuildType)' == 'Debug'">$(CDefines);DBG=1</CDefines>
273
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>
276
277     <RefAsmOutputDirectory>$(BinariesDirectory)\ref\</RefAsmOutputDirectory>
278
279   </PropertyGroup>
280
281   <PropertyGroup Condition="'$(BuildForCoreSystem)' == 'true' and ('$(HostMachineOS)'=='' or '$(HostMachineOS)' == 'OneCore' or '$(HostMachineOS)'=='OneCoreWin7Compat')">
282     <!--
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).
286
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. 
296
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.
301         
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
309     -->
310     <BuildForWindows7 Condition="'$(BuildForWindows7)'==''">true</BuildForWindows7>
311     <BuildForWindows7 Condition="'$(HostMachineOS)'=='OneCore'">false</BuildForWindows7>
312     <BuildForWindows7 Condition="'$(TargetArch)'=='arm' or '$(TargetArch)'=='arm64'">false</BuildForWindows7>
313
314     <SdkLibPath>$(CoreSystemSdkPath)\sdk\lib\mincore\$(BuildArchitecture)</SdkLibPath>
315     <SdkLibPath Condition="'$(BuildForWindows7)' == 'true'">$(ExternalAPIsPath)\Windows\Win7\$(BuildArchitecture)</SdkLibPath>
316
317     <CoreSystemCrt>$(SdkLibPath)\msvcrt.lib</CoreSystemCrt>
318     <CrtSecureDeprecate>true</CrtSecureDeprecate>
319     <LinkNoLibraries>true</LinkNoLibraries>
320     <LinkNoWin32Libraries>true</LinkNoWin32Libraries>
321     <NoWinXPSP3NXCompat>true</NoWinXPSP3NXCompat>
322   </PropertyGroup>
323 </Project>