[PATCH] msbuild integration: provide separate files for v100 and v110 integration
Hans Wennborg
hans at chromium.org
Thu Sep 5 20:05:00 PDT 2013
Hi rnk, whunt,
The current msbuild integration only works if VS2010 is installed. This patch renames the current integration to llvm-v100, and adds llvm-v110 files for VS2012.
http://llvm-reviews.chandlerc.com/D1614
Files:
tools/msbuild/CMakeLists.txt
tools/msbuild/Microsoft.Cpp.Win32.llvm-v100.props.in
tools/msbuild/Microsoft.Cpp.Win32.llvm-v100.targets
tools/msbuild/Microsoft.Cpp.Win32.llvm-v110.props.in
tools/msbuild/Microsoft.Cpp.Win32.llvm-v110.targets
tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in
tools/msbuild/Microsoft.Cpp.Win32.llvm.targets
tools/msbuild/install.bat
tools/msbuild/uninstall.bat
Index: tools/msbuild/CMakeLists.txt
===================================================================
--- tools/msbuild/CMakeLists.txt
+++ tools/msbuild/CMakeLists.txt
@@ -1,10 +1,13 @@
if (WIN32)
- set(prop_file "Microsoft.Cpp.Win32.llvm.props")
+ set(prop_file_v100 "Microsoft.Cpp.Win32.llvm-v100.props")
+ set(prop_file_v110 "Microsoft.Cpp.Win32.llvm-v110.props")
# CPack will install a registry key in this format that we wish to reference.
set(REG_KEY "${CMAKE_PROJECT_NAME} ${CPACK_PACKAGE_VERSION}")
- configure_file(${prop_file}.in ${prop_file})
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file}" DESTINATION tools/msbuild)
+ configure_file(${prop_file_v100}.in ${prop_file_v100})
+ configure_file(${prop_file_v110}.in ${prop_file_v110})
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file_v100}" DESTINATION tools/msbuild)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file_v110}" DESTINATION tools/msbuild)
install(DIRECTORY .
DESTINATION tools/msbuild
Index: tools/msbuild/Microsoft.Cpp.Win32.llvm-v100.props.in
===================================================================
--- /dev/null
+++ tools/msbuild/Microsoft.Cpp.Win32.llvm-v100.props.in
@@ -0,0 +1,10 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v100\Microsoft.Cpp.$(Platform).v100.props"/>
+
+ <PropertyGroup>
+ <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\@REG_KEY@)</LLVMInstallDir>
+ <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\@REG_KEY@)</LLVMInstallDir>
+ <ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath>
+ <LibraryPath>$(LLVMInstallDir)\lib\clang\3.4\lib\windows;$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+</Project>
Index: tools/msbuild/Microsoft.Cpp.Win32.llvm-v100.targets
===================================================================
--- /dev/null
+++ tools/msbuild/Microsoft.Cpp.Win32.llvm-v100.targets
@@ -0,0 +1,2 @@
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
Index: tools/msbuild/Microsoft.Cpp.Win32.llvm-v110.props.in
===================================================================
--- /dev/null
+++ tools/msbuild/Microsoft.Cpp.Win32.llvm-v110.props.in
@@ -0,0 +1,10 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v110\Microsoft.Cpp.$(Platform).v110.props"/>
+
+ <PropertyGroup>
+ <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\@REG_KEY@)</LLVMInstallDir>
+ <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\@REG_KEY@)</LLVMInstallDir>
+ <ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath>
+ <LibraryPath>$(LLVMInstallDir)\lib\clang\3.4\lib\windows;$(LibraryPath)</LibraryPath>
+ </PropertyGroup>
+</Project>
Index: tools/msbuild/Microsoft.Cpp.Win32.llvm-v110.targets
===================================================================
--- /dev/null
+++ tools/msbuild/Microsoft.Cpp.Win32.llvm-v110.targets
@@ -0,0 +1,3 @@
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(VCTargetsPath)\Microsoft.CppCommon.targets" />
+</Project>
Index: tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in
===================================================================
--- tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in
+++ /dev/null
@@ -1,10 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v100\Microsoft.Cpp.$(Platform).v100.props"/>
-
- <PropertyGroup>
- <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\@REG_KEY@)</LLVMInstallDir>
- <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\@REG_KEY@)</LLVMInstallDir>
- <ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath>
- <LibraryPath>$(LLVMInstallDir)\lib\clang\3.4\lib\windows;$(LibraryPath)</LibraryPath>
- </PropertyGroup>
-</Project>
Index: tools/msbuild/Microsoft.Cpp.Win32.llvm.targets
===================================================================
--- tools/msbuild/Microsoft.Cpp.Win32.llvm.targets
+++ /dev/null
@@ -1,2 +0,0 @@
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-</Project>
Index: tools/msbuild/install.bat
===================================================================
--- tools/msbuild/install.bat
+++ tools/msbuild/install.bat
@@ -1,28 +1,44 @@
@echo off
echo Installing MSVC integration...
+set SUCCESS=0
REM Change to the directory of this batch file.
cd /d %~dp0
REM Search for the MSBuild toolsets directory.
SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
-IF EXIST %D% GOTO FOUND_MSBUILD
+IF EXIST %D% GOTO FOUND_V100
SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
-IF EXIST %D% GOTO FOUND_MSBUILD
+IF EXIST %D% GOTO FOUND_V100
-echo Failed to find MSBuild toolsets directory.
-goto FAILED
+:TRY_V110
+SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
+IF EXIST %D% GOTO FOUND_V110
+SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
+IF EXIST %D% GOTO FOUND_V110
+
+IF NOT SUCCESS == 1 echo Failed to find MSBuild toolsets directory.
+IF NOT SUCCESS == 1 goto FAILED
-:FOUND_MSBUILD
-IF NOT EXIST %D%\llvm mkdir %D%\llvm
-IF NOT %ERRORLEVEL% == 0 GOTO FAILED
-copy Microsoft.Cpp.Win32.llvm.props %D%\llvm
+:FOUND_V100
+IF NOT EXIST %D%\llvm-v100 mkdir %D%\llvm-v100
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+copy Microsoft.Cpp.Win32.llvm-v100.props %D%\llvm-v100
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
-copy Microsoft.Cpp.Win32.llvm.targets %D%\llvm
+copy Microsoft.Cpp.Win32.llvm-v100.targets %D%\llvm-v100
IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+set SUCCESS=1
+GOTO TRY_V110
+:FOUND_V110
+IF NOT EXIST %D%\llvm-v110 mkdir %D%\llvm-v110
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+copy Microsoft.Cpp.Win32.llvm-v110.props %D%\llvm-v110
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+copy Microsoft.Cpp.Win32.llvm-v110.targets %D%\llvm-v110
+IF NOT %ERRORLEVEL% == 0 GOTO FAILED
echo Done!
goto END
Index: tools/msbuild/uninstall.bat
===================================================================
--- tools/msbuild/uninstall.bat
+++ tools/msbuild/uninstall.bat
@@ -5,30 +5,24 @@
REM CD to the directory of this batch file.
cd /d %~dp0
-REM Search for the MSBuild toolsets directory.
SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
-IF EXIST %D% GOTO FOUND_MSBUILD
-SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
-IF EXIST %D% GOTO FOUND_MSBUILD
+IF EXIST %D%\llvm-v100 del %D%\llvm-v100\Microsoft.Cpp.Win32.llvm-v100.props
+IF EXIST %D%\llvm-v100 del %D%\llvm-v100\Microsoft.Cpp.Win32.llvm-v100.targets
+IF EXIST %D%\llvm-v100 rmdir %D%\llvm-v100
-echo Failed to find MSBuild toolsets directory.
-goto FAILED
+SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets"
+IF EXIST %D%\llvm-v100 del %D%\llvm-v100\Microsoft.Cpp.Win32.llvm-v100.props
+IF EXIST %D%\llvm-v100 del %D%\llvm-v100\Microsoft.Cpp.Win32.llvm-v100.targets
+IF EXIST %D%\llvm-v100 rmdir %D%\llvm-v100
-:FOUND_MSBUILD
+SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
+IF EXIST %D%\llvm-v110 del %D%\llvm-v110\Microsoft.Cpp.Win32.llvm-v110.props
+IF EXIST %D%\llvm-v110 del %D%\llvm-v110\Microsoft.Cpp.Win32.llvm-v110.targets
+IF EXIST %D%\llvm-v110 rmdir %D%\llvm-v110
-del %D%\llvm\Microsoft.Cpp.Win32.llvm.props
-IF NOT %ERRORLEVEL% == 0 GOTO FAILED
-del %D%\llvm\Microsoft.Cpp.Win32.llvm.targets
-IF NOT %ERRORLEVEL% == 0 GOTO FAILED
-rmdir %D%\llvm
-IF NOT %ERRORLEVEL% == 0 GOTO FAILED
+SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\Win32\PlatformToolsets"
+IF EXIST %D%\llvm-v110 del %D%\llvm-v110\Microsoft.Cpp.Win32.llvm-v110.props
+IF EXIST %D%\llvm-v110 del %D%\llvm-v110\Microsoft.Cpp.Win32.llvm-v110.targets
+IF EXIST %D%\llvm-v110 rmdir %D%\llvm-v110
echo Done!
-goto END
-
-:FAILED
-echo MSVC integration uninstall failed.
-pause
-goto END
-
-:END
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1614.1.patch
Type: text/x-patch
Size: 8709 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130905/7ada5b68/attachment.bin>
More information about the llvm-commits
mailing list