From 522f9aec18bc15c920236e96a16c9984b4bc3a04 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 27 Aug 2018 21:53:36 +0000 Subject: Update the Visual Studio Integration from user feedback. This patch removes the MSBuild warnings about options that clang-cl ignores. It also adds several additional fields to the LLVM Configuration options page. The first is that it adds support for LLD! To give the user flexibility though, we don't want to force LLD to always-on, and if we're not forcing LLD then we might as well not force clang-cl either. So we add options that can enable or disable lld, clang-cl, or any combination of the two. Whenever one is disabled, it falls back to the Microsoft equivalent. Additionally, for each of clang-cl and lld-link, we add a new configuration setting that allows Additional Options to be passed for that specific tool only. This is similar to the C/C++ > Command Line > Additional Options entry box, but it serves the use case where a user switches back and forth between the toolsets in their vcxproj, but where cl.exe won't accept some options that clang-cl will. In this case you can pass those options in the clang-cl additional options and whenever clang-cl is disabled (or the other toolset is selected entirely), those options won't get passed at all. llvm-svn: 340780 --- llvm/tools/msbuild/LLVM.Cpp.Common.props | 5 +- llvm/tools/msbuild/LLVM.Cpp.Common.targets | 79 +++++++----------------------- llvm/tools/msbuild/llvm-general.xml | 40 +++++++++++++-- 3 files changed, 55 insertions(+), 69 deletions(-) (limited to 'llvm/tools/msbuild') diff --git a/llvm/tools/msbuild/LLVM.Cpp.Common.props b/llvm/tools/msbuild/LLVM.Cpp.Common.props index 9a50dcd8a45..3420b77cfff 100644 --- a/llvm/tools/msbuild/LLVM.Cpp.Common.props +++ b/llvm/tools/msbuild/LLVM.Cpp.Common.props @@ -41,6 +41,9 @@ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM) $(LLVMInstallDir)\ $(LLVMInstallDir)bin\clang-cl.exe + $(LLVMInstallDir)bin\lld-link.exe + true + true @@ -69,8 +72,6 @@ not pass the option). Only if the user explicitly overrode this setting in a project to use /RTCu would we see the warning. --> Default - - -m$(PlatformArchitecture) %(AdditionalOptions) diff --git a/llvm/tools/msbuild/LLVM.Cpp.Common.targets b/llvm/tools/msbuild/LLVM.Cpp.Common.targets index 458eba37647..5870a3d4c59 100644 --- a/llvm/tools/msbuild/LLVM.Cpp.Common.targets +++ b/llvm/tools/msbuild/LLVM.Cpp.Common.targets @@ -7,7 +7,8 @@ selected via the settings UI appear in the vcxproj (which is imported before the targets file but after the props file) and we need the path that the user may have overridden in the UI. --> - $(ClangClExecutable) + $(ClangClExecutable) + $(LldLinkExecutable) @@ -16,6 +17,20 @@ + + + + -m$(PlatformArchitecture) $(ClangClAdditionalOptions) %(AdditionalOptions) + + + + + + $(LldLinkAdditionalOptions) %(AdditionalOptions) + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + - - - + + + + + + + + + + + + -- cgit v1.2.3