Files
clang-p2996/llvm/tools/msbuild/LLVM.Cpp.Common.props
Zachary Turner 83226b913d Rewrite the VS integration scripts.
This is a new modernized VS integration installer.  It adds a
Visual Studio .sln file which, when built, outputs a VSIX that can
be used to install ourselves as a "real" Visual Studio Extension.
We can even upload this extension to the visual studio marketplace.

This fixes a longstanding problem where we didn't support installing
into VS 2017 and higher.  In addition to supporting VS 2017, due
to the way this is written we now longer need to do anything special
to support future versions of VS as well.  Everything should
"just work".  This also fixes several bugs with our old integration,
such as MSBuild triggering full rebuilds when /Zi was used.

Finally, we add a new UI page called "LLVM" which becomes visible
when the LLVM toolchain is selected.  For now this only contains
one option which is the path to clang-cl.exe, but in the future
we can add more things here.

Differential Revision: https://reviews.llvm.org/D42762

llvm-svn: 337572
2018-07-20 16:30:02 +00:00

76 lines
4.4 KiB
XML

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- The general order of executing an MSBuild file is roughly:
1) vcxproj file
2) ├─ Import Microsoft.Cpp.props
3) │ └─ Import Toolset specific props (e.g. $(VCTargets)Platforms\Win32\PlatformToolsets\llvm\Toolset.props)
4) │ └─ Import This File (LLVM.Cpp.Common.props)
5) │─ Core logic of vcxproj (define files, override properties, etc)
6) └─ Import Microsoft.Cpp.targets
7) │─ Import Toolset specific targets file (e.g. $(VCTargets)Platforms\Win32\PlatformToolsets\llvm\Toolset.targets)
8) └─ Run the compiler.
The important thing is that we have hooks at 3, 4, and 7. 3 and 4 give
us the ability to provide initial values for toolchain settings (where
is the compiler, what values are considered "default" for a given
setting, etc), 7 gives us the ability to act on anything that the user
has overridden (such as warning or erroring on incompatible settings,
mapping settings to other settings, etc).
-->
<PropertyGroup>
<!-- This initializes the values in Properties > General > Output Directory.
Builds will fail without this. -->
<OutDirWasSpecified Condition=" '$(OutDir)'!='' AND '$(OutDirWasSpecified)'=='' ">true</OutDirWasSpecified>
<OutDirWasSpecified Condition=" '$(OutDir)'=='' AND '$(OutDirWasSpecified)'=='' ">false</OutDirWasSpecified>
<IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'!=''">$(IntermediateOutputPath)</IntDir>
<IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'==''">$(Configuration)\</IntDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' != ''">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' == ''">$(IntDir)</OutDir>
<DebuggerFlavor Condition="'$(DebuggerFlavor)'==''">WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<!-- Short names for platform toolsets (added to project name in Solution Explorer) -->
<_PlatformToolsetShortNameFor_llvm>LLVM</_PlatformToolsetShortNameFor_llvm>
<_PlatformToolsetFriendlyNameFor_llvm>LLVM</_PlatformToolsetFriendlyNameFor_llvm>
</PropertyGroup>
<!-- Find an installed LLVM and set up our paths. -->
<PropertyGroup>
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM@LLVM)</LLVMInstallDir>
<LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM@LLVM)</LLVMInstallDir>
<ClangClExecutable>$(LLVMInstallDir)bin\clang-cl.exe</ClangClExecutable>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props" Condition="Exists('$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props')"/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Common.props" />
<PropertyGroup>
<!-- Set some paths (such as include paths) that are common to all platforms. This is the same as what
the default paths for cl will use.
-->
<IncludePath Condition="'$(IncludePath)' == ''">$(IncludePath);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryWPath Condition="'$(LibraryWPath)' == ''">$(WindowsSDK_MetadataPath);</LibraryWPath>
<SourcePath Condition="'$(SourcePath)' == ''">$(VC_SourcePath);</SourcePath>
</PropertyGroup>
<!-- Set values which are reflected in the property UI by default. The user can override these
by editing the vcxproj file (or making changes via the UI, which has the same effect).
-->
<ItemDefinitionGroup>
<ClCompile>
<!-- Set this to "Default" (which means not passing any /RTC option) so that any other value will
be treated as having been overridden by the user. This Serves as a hint to the user that
Default is the value we support, and other values will generate a warning. It also means
that if the user simply creates a new project in MSVC (which uses /RTCu by default), then
switches the toolset to Clang, we will still treat the value as default (which for us is to
not pass the option). Only if the user explicitly overrode this setting in a project to use
/RTCu would we see the warning. -->
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<AdditionalOptions>-m$(PlatformArchitecture) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
</Project>