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    <LLVMInstallDir Condition="'$(LLVMInstallDir)' != ''">$(LLVMInstallDir)\</LLVMInstallDir>
43    <ClangClExecutable>$(LLVMInstallDir)bin\clang-cl.exe</ClangClExecutable>
44    <LldLinkExecutable>$(LLVMInstallDir)bin\lld-link.exe</LldLinkExecutable>
45    <LlvmLibExecutable>$(LLVMInstallDir)bin\llvm-lib.exe</LlvmLibExecutable>
46    <UseClangCl>true</UseClangCl>
47    <UseLldLink>true</UseLldLink>
48    <UseLlvmLib>true</UseLlvmLib>
49  </PropertyGroup>
50
51  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props" Condition="Exists('$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props')"/>
52  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Common.props" />
53
54  <PropertyGroup>
55    <!-- Set some paths (such as include paths) that are common to all platforms.  This is the same as what
56         the default paths for cl will use.
57         -->
58    <IncludePath Condition="'$(IncludePath)' == ''">$(IncludePath);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
59    <LibraryWPath Condition="'$(LibraryWPath)' == ''">$(WindowsSDK_MetadataPath);</LibraryWPath>
60    <SourcePath Condition="'$(SourcePath)' == ''">$(VC_SourcePath);</SourcePath>
61  </PropertyGroup>
62
63
64  <!-- Set values which are reflected in the property UI by default.  The user can override these
65       by editing the vcxproj file (or making changes via the UI, which has the same effect).
66       -->
67  <ItemDefinitionGroup>
68    <ClCompile>
69      <!-- Set this to "Default" (which means not passing any /RTC option) so that any other value will
70           be treated as having been overridden by the user.  This Serves as a hint to the user that
71           Default is the value we support, and other values will generate a warning.  It also means
72           that if the user simply creates a new project in MSVC (which uses /RTCu by default), then
73           switches the toolset to Clang, we will still treat the value as default (which for us is to
74           not pass the option).  Only if the user explicitly overrode this setting in a project to use
75           /RTCu would we see the warning. -->
76      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
77    </ClCompile>
78  </ItemDefinitionGroup>
79</Project>
80