1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 2 <!-- The general order of executing an MSBuild file is roughly: 3 1) vcxproj file 4 2) ├─ Import Microsoft.Cpp.props 5 3) │ └─ Import Toolset specific props (e.g. $(VCTargets)Platforms\Win32\PlatformToolsets\llvm\Toolset.props) 6 4) │ └─ Import This File (LLVM.Cpp.Common.props) 7 5) │─ Core logic of vcxproj (define files, override properties, etc) 8 6) └─ Import Microsoft.Cpp.targets 9 7) │─ Import Toolset specific targets file (e.g. $(VCTargets)Platforms\Win32\PlatformToolsets\llvm\Toolset.targets) 10 8) └─ Run the compiler. 11 The important thing is that we have hooks at 3, 4, and 7. 3 and 4 give 12 us the ability to provide initial values for toolchain settings (where 13 is the compiler, what values are considered "default" for a given 14 setting, etc), 7 gives us the ability to act on anything that the user 15 has overridden (such as warning or erroring on incompatible settings, 16 mapping settings to other settings, etc). 17 --> 18 19 <PropertyGroup> 20 <!-- This initializes the values in Properties > General > Output Directory. 21 Builds will fail without this. --> 22 <OutDirWasSpecified Condition=" '$(OutDir)'!='' AND '$(OutDirWasSpecified)'=='' ">true</OutDirWasSpecified> 23 <OutDirWasSpecified Condition=" '$(OutDir)'=='' AND '$(OutDirWasSpecified)'=='' ">false</OutDirWasSpecified> 24 25 <IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'!=''">$(IntermediateOutputPath)</IntDir> 26 <IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'==''">$(Configuration)\</IntDir> 27 <OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' != ''">$(SolutionDir)$(Configuration)\</OutDir> 28 <OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' == ''">$(IntDir)</OutDir> 29 <DebuggerFlavor Condition="'$(DebuggerFlavor)'==''">WindowsLocalDebugger</DebuggerFlavor> 30 </PropertyGroup> 31 32 <PropertyGroup> 33 <!-- Short names for platform toolsets (added to project name in Solution Explorer) --> 34 <_PlatformToolsetShortNameFor_llvm>LLVM</_PlatformToolsetShortNameFor_llvm> 35 <_PlatformToolsetFriendlyNameFor_llvm>LLVM</_PlatformToolsetFriendlyNameFor_llvm> 36 </PropertyGroup> 37 38 <!-- Find an installed LLVM and set up our paths. --> 39 <PropertyGroup> 40 <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM@LLVM)</LLVMInstallDir> 41 <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM@LLVM)</LLVMInstallDir> 42 <ClangClExecutable>$(LLVMInstallDir)bin\clang-cl.exe</ClangClExecutable> 43 </PropertyGroup> 44 45 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props" Condition="Exists('$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props')"/> 46 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Common.props" /> 47 48 <PropertyGroup> 49 <!-- Set some paths (such as include paths) that are common to all platforms. This is the same as what 50 the default paths for cl will use. 51 --> 52 <IncludePath Condition="'$(IncludePath)' == ''">$(IncludePath);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath> 53 <LibraryWPath Condition="'$(LibraryWPath)' == ''">$(WindowsSDK_MetadataPath);</LibraryWPath> 54 <SourcePath Condition="'$(SourcePath)' == ''">$(VC_SourcePath);</SourcePath> 55 </PropertyGroup> 56 57 58 <!-- Set values which are reflected in the property UI by default. The user can override these 59 by editing the vcxproj file (or making changes via the UI, which has the same effect). 60 --> 61 <ItemDefinitionGroup> 62 <ClCompile> 63 <!-- Set this to "Default" (which means not passing any /RTC option) so that any other value will 64 be treated as having been overridden by the user. This Serves as a hint to the user that 65 Default is the value we support, and other values will generate a warning. It also means 66 that if the user simply creates a new project in MSVC (which uses /RTCu by default), then 67 switches the toolset to Clang, we will still treat the value as default (which for us is to 68 not pass the option). Only if the user explicitly overrode this setting in a project to use 69 /RTCu would we see the warning. --> 70 <BasicRuntimeChecks>Default</BasicRuntimeChecks> 71 72 <AdditionalOptions>-m$(PlatformArchitecture) %(AdditionalOptions)</AdditionalOptions> 73 </ClCompile> 74 </ItemDefinitionGroup> 75</Project> 76