Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
Initial commit for v7. Ref #7
Browse files Browse the repository at this point in the history
  • Loading branch information
arves100 committed Dec 29, 2018
1 parent 2d847fe commit 75d7da0
Show file tree
Hide file tree
Showing 10 changed files with 335 additions and 16 deletions.
44 changes: 44 additions & 0 deletions AutoSetup.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@echo off
REM LLVM 4+ MSBuild 15 Integration
REM Creation Date: 07-11-2017
REM Update Date: 28-03-2017
REM If you haven't received a copy of the LICENSe, See: Uol-NCSA License

set VS_REGVAL=15.0

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set VS_REGKEY=HKLM\Software\WOW6432Node\Microsoft\VisualStudio\SxS\VS7)
if not "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set VS_REGKEY=HKLM\Software\Microsoft\VisualStudio\SxS\VS7)

reg query %VS_REGKEY% /v %VS_REGVAL% 2>nul || (echo No vs2017 registry key present! & exit /b 1)

set VS_DIR=
for /f "tokens=2,*" %%a in ('reg query %VS_REGKEY% /v %VS_REGVAL% ^| findstr %VS_REGVAL%') do (
set VS_DIR=%%b
)

if not defined VS_DIR (echo Cannot find Visual Studio 2017 directory! & exit /b 1)

set VS_PROOT_DIR=%VS_DIR%\Common7\IDE\VC\VCTargets\Platforms

if not exist "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017" (mkdir "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017")
if not exist "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017_xp" (mkdir "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017_xp")
copy Toolset-llvm-vs2017-x86.props "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017\Toolset.props"
copy Toolset-llvm-vs2017-x86.targets "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017\Toolset.targets"
copy Toolset-llvm-vs2017-xp-x86.props "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017_xp\Toolset.props"
copy Toolset-llvm-vs2017-xp-x86.targets "%VS_PROOT_DIR%\Win32\PlatformToolsets\LLVM-vs2017_xp\Toolset.targets"

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto install_x64
if not "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto done

:install_x64
if not exist "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017" (mkdir "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017")
if not exist "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017_xp" (mkdir "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017_xp")
copy Toolset-llvm-vs2017-x64.props "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017\Toolset.props"
copy Toolset-llvm-vs2017-x64.targets "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017\Toolset.targets"
copy Toolset-llvm-vs2017-xp-x64.props "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017_xp\Toolset.props"
copy Toolset-llvm-vs2017-xp-x64.targets "%VS_PROOT_DIR%\x64\PlatformToolsets\LLVM-vs2017_xp\Toolset.targets"
goto done

:done
echo Setup OK!
pause
18 changes: 2 additions & 16 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
# LLVM Visual Studio 2017 Integration
# Visual Studio 2017 Integration for LLVM 7.0

This repository contains Visual Studio 2017 integration for various LLVM versions.

Pull requests for new versions are welcome, just create a branch and adjust the configuration.

### How to use it?
Simply fork the branch related to your version

| LLVM Version | Branch |
| ------------ | ------ |
| 5.0.0 | v5.0 |
| 6.0.0 | v6.0 |

### LICENSE

Released under Uol-NCSA (Same license as LLVM)
See "master" branch for instruction about installing
50 changes: 50 additions & 0 deletions Toolset-llvm-vs2017-x64.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)ImportBefore\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportBefore')" />

<PropertyGroup>
<!-- Required for enabling Team Build for packaging Windows Store app projects -->
<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)'==''">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' == ''">$(IntDir)</OutDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' != ''">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props" Condition="Exists('$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props')"/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Common.props" />

<PropertyGroup>
<ExecutablePath Condition="'$(ExecutablePath)' == ''">$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);</ExecutablePath>
<IncludePath Condition="'$(IncludePath)' == ''">$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<ReferencePath Condition="'$(ReferencePath)' == ''">$(VC_ReferencesPath_x64);</ReferencePath>
<LibraryPath Condition="'$(LibraryPath)' == ''">$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64</LibraryPath>
<LibraryWPath Condition="'$(LibraryWPath)' == ''">$(WindowsSDK_MetadataPath);</LibraryWPath>
<SourcePath Condition="'$(SourcePath)' == ''">$(VC_SourcePath);</SourcePath>
<ExcludePath Condition="'$(ExcludePath)' == ''">$(VC_IncludePath);$(WindowsSDK_IncludePath);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x64);</ExcludePath>
<DebugCppRuntimeFilesPath Condition="'$(DebugCppRuntimeFilesPath)' == ''">$(VCToolsInstallDir)redist\Debug_NonRedist\x64</DebugCppRuntimeFilesPath>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)ImportAfter\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportAfter')" />

<!-- This is intentially added after ImportAfter. -->
<Import Project="$(_PlatformFolder)Platform.Common.props" />

<PropertyGroup>
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM)</LLVMInstallDir>
<LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM)</LLVMInstallDir>
<ExecutablePath>$(LLVMInstallDir)\bin;$(ExecutablePath)</ExecutablePath>
<IncludePath>$(LLVMInstallDir)\lib\clang\7.0.0\include;$(IncludePath)</IncludePath> <LibraryPath>$(LLVMInstallDir)\lib\clang\7.0.0\lib\windows;$(LibraryPath)</LibraryPath>
<VCToolArchitecture>Native64Bit</VCToolArchitecture>
<CLToolExe>clang-cl.exe</CLToolExe>
<CLToolPath>$(LLVMInstallDir)\bin</CLToolPath>
</PropertyGroup>

<ItemDefinitionGroup>
<ClCompile>
<!-- Set the value of _MSC_VER to claim for compatibility -->
<AdditionalOptions>-m64 -fmsc-version=1910 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
</Project>
3 changes: 3 additions & 0 deletions Toolset-llvm-vs2017-x64.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />
</Project>
50 changes: 50 additions & 0 deletions Toolset-llvm-vs2017-x86.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)ImportBefore\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportBefore')" />

<PropertyGroup>
<!-- Required for enabling Team Build for packaging Windows Store app projects -->
<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)'==''">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' == ''">$(IntDir)</OutDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' != ''">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props" Condition="Exists('$(VCTargetsPath)\Microsoft.Cpp.WindowsSDK.props')"/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Common.props" />

<PropertyGroup>
<ExecutablePath Condition="'$(ExecutablePath)' == ''">$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);</ExecutablePath>
<IncludePath Condition="'$(IncludePath)' == ''">$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<ReferencePath Condition="'$(ReferencePath)' == ''">$(VC_ReferencesPath_x86);</ReferencePath>
<LibraryPath Condition="'$(LibraryPath)' == ''">$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
<LibraryWPath Condition="'$(LibraryWPath)' == ''">$(WindowsSDK_MetadataPath);</LibraryWPath>
<SourcePath Condition="'$(SourcePath)' == ''">$(VC_SourcePath);</SourcePath>
<ExcludePath Condition="'$(ExcludePath)' == ''">$(VC_IncludePath);$(WindowsSDK_IncludePath);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x86);</ExcludePath>
<DebugCppRuntimeFilesPath Condition="'$(DebugCppRuntimeFilesPath)' == ''">$(VCToolsInstallDir)redist\Debug_NonRedist\x86</DebugCppRuntimeFilesPath>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)ImportAfter\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportAfter')" />

<!-- This is intentially added after ImportAfter. -->
<Import Project="$(_PlatformFolder)Platform.Common.props" />

<PropertyGroup>
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM)</LLVMInstallDir>
<LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM)</LLVMInstallDir>
<ExecutablePath>$(LLVMInstallDir)\bin;$(ExecutablePath)</ExecutablePath>
<IncludePath>$(LLVMInstallDir)\lib\clang\7.0.0\include;$(IncludePath)</IncludePath>
<LibraryPath>$(LLVMInstallDir)\lib\clang\7.0.0\lib\windows;$(LibraryPath)</LibraryPath>
<CLToolExe>clang-cl.exe</CLToolExe>
<CLToolPath>$(LLVMInstallDir)\bin</CLToolPath>
</PropertyGroup>

<ItemDefinitionGroup>
<ClCompile>
<!-- Set the value of _MSC_VER to claim for compatibility -->
<AdditionalOptions>-m32 -fmsc-version=1910 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
</Project>
3 changes: 3 additions & 0 deletions Toolset-llvm-vs2017-x86.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />
</Project>
71 changes: 71 additions & 0 deletions Toolset-llvm-vs2017-xp-x64.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)ImportBefore\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportBefore')" />

<PropertyGroup>
<!-- Required for enabling Team Build for packaging Windows Store app projects -->
<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)'==''">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' == ''">$(IntDir)</OutDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' != ''">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>

<DefineWindowsSDK_71A>true</DefineWindowsSDK_71A>
<!-- For desktop projects targeting XP, override the SDKDisplayName and WindowsTargetPlatformVersion to windows 7.0 so that the correct TPI and TPV are displayed in the UI -->
<SDKDisplayName>Windows</SDKDisplayName>
<WindowsTargetPlatformVersion>7.0</WindowsTargetPlatformVersion>
</PropertyGroup>

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Common.props" />


<PropertyGroup>
<ExecutablePath Condition="'$(ExecutablePath)' == ''">$(VC_ExecutablePath_x64);$(WindowsSdk_71A_ExecutablePath);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);</ExecutablePath>
<IncludePath Condition="'$(IncludePath)' == ''">$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);</IncludePath>
<ReferencePath Condition="'$(ReferencePath)' == ''">$(VC_ReferencesPath_x64);</ReferencePath>
<LibraryPath Condition="'$(LibraryPath)' == ''">$(VC_LibraryPath_x64);$(WindowsSdk_71A_LibraryPath_x64);</LibraryPath>
<SourcePath Condition="'$(SourcePath)' == ''">$(VC_SourcePath);</SourcePath>
<ExcludePath Condition="'$(ExcludePath)' == ''">$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x64);</ExcludePath>
<DebugCppRuntimeFilesPath Condition="'$(DebugCppRuntimeFilesPath)' == ''">$(VCToolsInstallDir)redist\Debug_NonRedist\x64</DebugCppRuntimeFilesPath>
</PropertyGroup>

<ItemDefinitionGroup>
<ClCompile>
<!-- Add /D_USING_V110_SDK71_ when targeting XP -->
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_USING_V110_SDK71_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- For legacy reasons, the resource editor doesn't send any defines to the resource compiler. This property allows for
sending special options to solve issues that are known to not introduce other problems that arbitrary defines may cause. -->
<DesigntimePreprocessorDefinitions>_USING_V110_SDK71_;%(DesigntimePreprocessorDefinitions)</DesigntimePreprocessorDefinitions>
</ResourceCompile>
<Link>
<MinimumRequiredVersion>5.02</MinimumRequiredVersion>
</Link>
</ItemDefinitionGroup>

<Import Project="$(MSBuildThisFileDirectory)ImportAfter\*.props" Condition="Exists('$(MSBuildThisFileDirectory)ImportAfter')" />

<!-- This is intentially added after ImportAfter. -->
<Import Project="$(_PlatformFolder)Platform.Common.props" />

<PropertyGroup>
<LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM)</LLVMInstallDir>
<LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM)</LLVMInstallDir>
<ExecutablePath>$(LLVMInstallDir)\bin;$(ExecutablePath)</ExecutablePath>
<IncludePath>$(LLVMInstallDir)\lib\clang\7.0.0\include;$(IncludePath)</IncludePath>
<LibraryPath>$(LLVMInstallDir)\lib\clang\7.0.0\lib\windows;$(LibraryPath)</LibraryPath>
<VCToolArchitecture>Native64Bit</VCToolArchitecture>
<CLToolExe>clang-cl.exe</CLToolExe>
<CLToolPath>$(LLVMInstallDir)\bin</CLToolPath>
</PropertyGroup>

<ItemDefinitionGroup>
<ClCompile>
<!-- Set the value of _MSC_VER to claim for compatibility -->
<AdditionalOptions>-m64 -fmsc-version=1910 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
</Project>
21 changes: 21 additions & 0 deletions Toolset-llvm-vs2017-xp-x64.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Force TargetFrameworkVersion to v4.0 to support XP-->
<PropertyGroup>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<BeforeClCompileTargets>NoSupportCodeAnalysisXP;$(BeforeClCompileTargets)</BeforeClCompileTargets>
</PropertyGroup>

<Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />

<Target Name="NoSupportCodeAnalysisXP" Condition="'$(ErrorNoSupportCodeAnalysisXP)' != 'false'">
<VCMessage Condition="'$(DesignTimeBuild)' != 'true' and '@(ClCompile->AnyHaveMetadataValue('EnablePREfast', 'true'))'=='true'" Code="MSB8026" Type="Error"/>
</Target>

<PropertyGroup>
<PrepareForBuildDependsOn>CheckWindowsSDK71A;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn>
</PropertyGroup>

<Target Name="CheckWindowsSDK71A">
<VCMessage Code="MSB8003" Type="Warning" Arguments="WindowsSdkDir_71A" Condition="'$(WindowsSdkDir_71A)'=='' and '$(UseEnv)' != 'true'" />
</Target>
</Project>
Loading

0 comments on commit 75d7da0

Please sign in to comment.