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