diff options
| author | Russell Gallop <russell.gallop@gmail.com> | 2019-04-29 10:10:17 +0000 |
|---|---|---|
| committer | Russell Gallop <russell.gallop@gmail.com> | 2019-04-29 10:10:17 +0000 |
| commit | d8212edf6840cf44f381da81039fa17a35e6102c (patch) | |
| tree | 923a2ce43a62f1e13a78190e392f05bde8f58dc0 | |
| parent | 1536717733bb9848f12f4e0aae871d0fba1c7798 (diff) | |
| download | bcm5719-llvm-d8212edf6840cf44f381da81039fa17a35e6102c.tar.gz bcm5719-llvm-d8212edf6840cf44f381da81039fa17a35e6102c.zip | |
vs integration: Use llvm-lib for librarian
This uses llvm-lib.exe for the librarian instead of Visual Studio
provided lib.exe. Without this it is not possible to create static
libraries with -flto using the plugin.
Original patch by Steven Noonan
This fixes: PR41147
Differential Revision: https://reviews.llvm.org/D61193
llvm-svn: 359430
| -rw-r--r-- | llvm/tools/msbuild/LLVM.Cpp.Common.props | 2 | ||||
| -rw-r--r-- | llvm/tools/msbuild/LLVM.Cpp.Common.targets | 1 | ||||
| -rw-r--r-- | llvm/tools/msbuild/llvm-general.xml | 21 |
3 files changed, 24 insertions, 0 deletions
diff --git a/llvm/tools/msbuild/LLVM.Cpp.Common.props b/llvm/tools/msbuild/LLVM.Cpp.Common.props index 3420b77cfff..bc021b3b9e1 100644 --- a/llvm/tools/msbuild/LLVM.Cpp.Common.props +++ b/llvm/tools/msbuild/LLVM.Cpp.Common.props @@ -42,8 +42,10 @@ <LLVMInstallDir Condition="'$(LLVMInstallDir)' != ''">$(LLVMInstallDir)\</LLVMInstallDir>
<ClangClExecutable>$(LLVMInstallDir)bin\clang-cl.exe</ClangClExecutable>
<LldLinkExecutable>$(LLVMInstallDir)bin\lld-link.exe</LldLinkExecutable>
+ <LlvmLibExecutable>$(LLVMInstallDir)bin\llvm-lib.exe</LlvmLibExecutable>
<UseClangCl>true</UseClangCl>
<UseLldLink>true</UseLldLink>
+ <UseLlvmLib>true</UseLlvmLib>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props" Condition="Exists('$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props')"/>
diff --git a/llvm/tools/msbuild/LLVM.Cpp.Common.targets b/llvm/tools/msbuild/LLVM.Cpp.Common.targets index 5870a3d4c59..74a98d6439b 100644 --- a/llvm/tools/msbuild/LLVM.Cpp.Common.targets +++ b/llvm/tools/msbuild/LLVM.Cpp.Common.targets @@ -9,6 +9,7 @@ that the user may have overridden in the UI. -->
<CLToolExe Condition="$(UseClangCl)">$(ClangClExecutable)</CLToolExe>
<LinkToolExe Condition="$(UseLldLink)">$(LldLinkExecutable)</LinkToolExe>
+ <LIBToolExe Condition="$(UseLlvmLib)">$(LlvmLibExecutable)</LIBToolExe>
</PropertyGroup>
<ItemGroup>
diff --git a/llvm/tools/msbuild/llvm-general.xml b/llvm/tools/msbuild/llvm-general.xml index a14a6844151..66a2cfec0b4 100644 --- a/llvm/tools/msbuild/llvm-general.xml +++ b/llvm/tools/msbuild/llvm-general.xml @@ -52,4 +52,25 @@ Category="General">
</StringProperty>
+
+ <BoolProperty Name="UseLlvmLib"
+ DisplayName="Use llvm-lib"
+ Description="Use llvm-lib for managing libraries. If this option is disabled, the Microsoft librarian (lib.exe) will be used instead."
+ Category="General"
+ Default="true">
+ </BoolProperty>
+ <StringProperty Name="LlvmLibExecutable"
+ DisplayName="llvm-lib Executable"
+ Description="Specifies the path to llvm-lib.exe."
+ Category="General"
+ Default="$(LLVMInstallDir)bin\llvm-lib.exe"
+ Subtype="file">
+ </StringProperty>
+
+ <StringProperty Name="LlvmLibAdditionalOptions"
+ DisplayName="Additional Librarian Options"
+ Description="Additional options to pass to llvm-lib. This is essentially the same as General > Librarian > Command Line > Additional Options, except that it is safe to put options here that will be rejected by lib.exe in case you switch toolchains back and forth."
+ Category="General">
+ </StringProperty>
+
</Rule>
|

