Skip to content

Commit

Permalink
Remove hard-coded Clang version (for Clang include path and library p…
Browse files Browse the repository at this point in the history
…ath) and MSVC version, they are handled internally by Clang.
  • Loading branch information
zufuliu committed Dec 29, 2018
1 parent fa4df8e commit ea32123
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
7 changes: 2 additions & 5 deletions VS2017/LLVM/LLVM.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
that the user may have overridden in the UI. -->
<CLToolExe Condition="$(UseClangCl)">$(ClangClExecutable)</CLToolExe>
<LinkToolExe Condition="$(UseLldLink)">$(LldLinkExecutable)</LinkToolExe>
<IncludePath Condition="$(UseClangCl)">$(LLVMInstallDir)\lib\clang\8.0.0\include;$(IncludePath)</IncludePath>
<LibraryPath Condition="$(UseClangCl)">$(LLVMInstallDir)\lib\clang\8.0.0\lib\windows;$(LibraryPath)</LibraryPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,9 +19,8 @@
general purpose list of command line flags. -->
<ItemDefinitionGroup Condition="$(UseClangCl)">
<ClCompile>
<!-- Set the value of _MSC_VER to claim for compatibility -->
<AdditionalOptions Condition="'$(Platform)' != 'ARM64'">-m$(PlatformArchitecture) -fmsc-version=1916 $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Platform)' == 'ARM64'">--target=aarch64-pc-windows-msvc -fmsc-version=1916 $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Platform)' != 'ARM64'">-m$(PlatformArchitecture) $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Platform)' == 'ARM64'">--target=aarch64-pc-windows-msvc $(ClangClAdditionalOptions) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>

Expand Down
22 changes: 3 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LLVM Utils

## LLVM (8.0) for Visual Studio 2017
## LLVM for Visual Studio 2017

### Installation
Please download and install LLVM from http://llvm.org/builds/ or http://releases.llvm.org/.
Expand All @@ -17,23 +17,7 @@ please manually copy folder *LLVM v141* and *LLVM v141_xp* under `VS2017` to fol
|`VS2017\LLVM v141_xp` | `%VS_PATH%\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\` |
|`VS2017\LLVM v141` | `%VS_PATH%\Common7\IDE\VC\VCTargets\Platforms\ARM64\PlatformToolsets\` |

or run `VS2017\install.bat` directly (which may require Administrator privilege. In Windows 8 or later, you can quickly open an elevated PowerShell prompt by File -> Open Windows PowerShell -> Open PowerShell as Administrator).

Notes:
* Old versions can be found at [release list](https://github.com/zufuliu/llvm-utils/tags), if you don't like to follow the following steps.
* If your LLVM version is not 8.0, please change `$(LLVMInstallDir)\lib\clang\8.0.0\` in *LLVM\LLVM.Common.targets* to appropriate value.
* If your VC compiler version is not `19.16.*` (VS2017 15.9, type `cl` in Command Prompt or find it in `%VS_PATH%\VC\Tools\MSVC`), please change `-fmsc-version=1916` in in *LLVM\LLVM.Common.targets* to appropriate value. A full list of `_MSC_VER` can be found at https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering, here is a brief list:

| Visual Studio Version | `_MSC_VER` |
|-----------------------|------------|
| Visual Studio 2017 15.9 | 1916 |
| Visual Studio 2017 15.8 | 1915 |
| Visual Studio 2017 15.7 | 1914 |
| Visual Studio 2017 15.6 | 1913 |
| Visual Studio 2017 15.5 | 1912 |
| Visual Studio 2017 15.3 | 1911 |
| Visual Studio 2017 15.0 | 1910 |
| Visual Studio 2015 14.0 | 1900 |
or run `VS2017\install.bat` directly (may require Administrator privilege. In Windows 8 or later, you can quickly open an elevated PowerShell prompt by File -> Open Windows PowerShell -> Open PowerShell as Administrator).

### Usage
Select *LLVM v141* or *LLVM v141_xp* as your project Platform Toolset.
Expand All @@ -55,7 +39,7 @@ Please note that LLVM 7.0.0 on AppVeyor doesn't support ARM64.
The huge size of LLVM Windows installation can be reduced dramatically by using Windows symbolic link (see [mklink command](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink).

### Usage
Just copy *llvm\llvm-link.bat* to LLVM installation path (such as `C:\Program Files\LLVM\`), and run it (which may require Administrator privilege).
Just copy *llvm\llvm-link.bat* to LLVM installation path (such as `C:\Program Files\LLVM\`), and run it (may require Administrator privilege).

## [License](../master/license.txt)

Expand Down

0 comments on commit ea32123

Please sign in to comment.