From 83226b913db55b2a4efa6057e38d3aabc36e5424 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 20 Jul 2018 16:30:02 +0000 Subject: [PATCH] Rewrite the VS integration scripts. This is a new modernized VS integration installer. It adds a Visual Studio .sln file which, when built, outputs a VSIX that can be used to install ourselves as a "real" Visual Studio Extension. We can even upload this extension to the visual studio marketplace. This fixes a longstanding problem where we didn't support installing into VS 2017 and higher. In addition to supporting VS 2017, due to the way this is written we now longer need to do anything special to support future versions of VS as well. Everything should "just work". This also fixes several bugs with our old integration, such as MSBuild triggering full rebuilds when /Zi was used. Finally, we add a new UI page called "LLVM" which becomes visible when the LLVM toolchain is selected. For now this only contains one option which is the path to clang-cl.exe, but in the future we can add more things here. Differential Revision: https://reviews.llvm.org/D42762 llvm-svn: 337572 --- clang/tools/driver/CMakeLists.txt | 4 - llvm/CMakeLists.txt | 4 - llvm/tools/msbuild/.gitignore | 2 + llvm/tools/msbuild/CMakeLists.txt | 69 -------- llvm/tools/msbuild/LLVM.Cpp.Common.props | 75 +++++++++ llvm/tools/msbuild/LLVM.Cpp.Common.targets | 184 +++++++++++++++++++++ .../Microsoft.Cpp.Win32.LLVM-vs2010.targets | 2 - .../Microsoft.Cpp.Win32.LLVM-vs2012.targets | 3 - .../Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets | 21 --- .../msbuild/Microsoft.Cpp.Win32.llvm.props.in | 18 -- llvm/tools/msbuild/Platformx64/Toolset.props | 11 ++ llvm/tools/msbuild/Platformx64/Toolset.targets | 3 + llvm/tools/msbuild/Platformx86/Toolset.props | 11 ++ llvm/tools/msbuild/Platformx86/Toolset.targets | 3 + llvm/tools/msbuild/install.bat | 180 +++++++------------- llvm/tools/msbuild/license.txt | 39 +++++ llvm/tools/msbuild/llvm-general.xml | 25 +++ llvm/tools/msbuild/llvm.csproj | 100 +++++++++++ llvm/tools/msbuild/llvm.sln | 25 +++ llvm/tools/msbuild/source.extension.vsixmanifest | 22 +++ llvm/tools/msbuild/toolset-vs2013.targets | 3 - llvm/tools/msbuild/toolset-vs2013_xp.targets | 21 --- llvm/tools/msbuild/toolset-vs2014.targets | 3 - llvm/tools/msbuild/toolset-vs2014_xp.targets | 21 --- llvm/tools/msbuild/uninstall.bat | 106 ++++-------- 25 files changed, 590 insertions(+), 365 deletions(-) create mode 100644 llvm/tools/msbuild/.gitignore delete mode 100644 llvm/tools/msbuild/CMakeLists.txt create mode 100644 llvm/tools/msbuild/LLVM.Cpp.Common.props create mode 100644 llvm/tools/msbuild/LLVM.Cpp.Common.targets delete mode 100644 llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2010.targets delete mode 100644 llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012.targets delete mode 100644 llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets delete mode 100644 llvm/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in create mode 100644 llvm/tools/msbuild/Platformx64/Toolset.props create mode 100644 llvm/tools/msbuild/Platformx64/Toolset.targets create mode 100644 llvm/tools/msbuild/Platformx86/Toolset.props create mode 100644 llvm/tools/msbuild/Platformx86/Toolset.targets create mode 100644 llvm/tools/msbuild/license.txt create mode 100644 llvm/tools/msbuild/llvm-general.xml create mode 100644 llvm/tools/msbuild/llvm.csproj create mode 100644 llvm/tools/msbuild/llvm.sln create mode 100644 llvm/tools/msbuild/source.extension.vsixmanifest delete mode 100644 llvm/tools/msbuild/toolset-vs2013.targets delete mode 100644 llvm/tools/msbuild/toolset-vs2013_xp.targets delete mode 100644 llvm/tools/msbuild/toolset-vs2014.targets delete mode 100644 llvm/tools/msbuild/toolset-vs2014_xp.targets diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt index db7055e..15b0519 100644 --- a/clang/tools/driver/CMakeLists.txt +++ b/clang/tools/driver/CMakeLists.txt @@ -63,10 +63,6 @@ add_dependencies(clang clang-headers) if(NOT CLANG_LINKS_TO_CREATE) set(CLANG_LINKS_TO_CREATE clang++ clang-cl clang-cpp) - - if (MSVC) - list(APPEND CLANG_LINKS_TO_CREATE ../msbuild-bin/cl) - endif() endif() foreach(link ${CLANG_LINKS_TO_CREATE}) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 955cf94..e546720 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -231,10 +231,6 @@ if(WIN32 AND NOT UNIX) set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\cmake\\\\nsis_icon.ico") set(CPACK_NSIS_MODIFY_PATH "ON") set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON") - set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS - "ExecWait '$INSTDIR/tools/msbuild/install.bat'") - set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - "ExecWait '$INSTDIR/tools/msbuild/uninstall.bat'") if( CMAKE_CL_64 ) set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") endif() diff --git a/llvm/tools/msbuild/.gitignore b/llvm/tools/msbuild/.gitignore new file mode 100644 index 0000000..01c1f5a --- /dev/null +++ b/llvm/tools/msbuild/.gitignore @@ -0,0 +1,2 @@ +bin +obj diff --git a/llvm/tools/msbuild/CMakeLists.txt b/llvm/tools/msbuild/CMakeLists.txt deleted file mode 100644 index 9d132ea..0000000 --- a/llvm/tools/msbuild/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -if (MSVC) - # CPack will install a registry key in this format that we wish to reference. - set(REG_KEY "${CPACK_PACKAGE_INSTALL_REGISTRY_KEY}") - set(LIB_PATH_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}") - - foreach (platform "Win32" "x64") - set(prop_file_in "Microsoft.Cpp.Win32.llvm.props.in") - set(prop_file_v100 "Microsoft.Cpp.${platform}.LLVM-vs2010.props") - set(prop_file_v110 "Microsoft.Cpp.${platform}.LLVM-vs2012.props") - set(prop_file_v110_xp "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.props") - set(prop_file_v120 "toolset-vs2013.props") - set(prop_file_v120_xp "toolset-vs2013_xp.props") - set(prop_file_v140 "toolset-vs2014.props") - set(prop_file_v140_xp "toolset-vs2014_xp.props") - - if (platform STREQUAL "Win32") - set(mflag "m32") - else() - set(mflag "m64") - endif() - set(VS_VERSION "v100") - set(MSC_VERSION "1600") - configure_file(${prop_file_in} ${platform}/${prop_file_v100}) - set(VS_VERSION "v110") - set(MSC_VERSION "1700") - configure_file(${prop_file_in} ${platform}/${prop_file_v110}) - set(VS_VERSION "v110_xp") - configure_file(${prop_file_in} ${platform}/${prop_file_v110_xp}) - set(VS_VERSION "v120") - set(MSC_VERSION "1800") - configure_file(${prop_file_in} ${platform}/${prop_file_v120}) - set(VS_VERSION "v120_xp") - configure_file(${prop_file_in} ${platform}/${prop_file_v120_xp}) - set(VS_VERSION "v140") - set(MSC_VERSION "1900") - configure_file(${prop_file_in} ${platform}/${prop_file_v140}) - set(VS_VERSION "v140_xp") - configure_file(${prop_file_in} ${platform}/${prop_file_v140_xp}) - set(VS_VERSION) - set(MSC_VERSION) - set(mflag) - - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v100}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v110_xp}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v120_xp}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140}" DESTINATION tools/msbuild/${platform}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${platform}/${prop_file_v140_xp}" DESTINATION tools/msbuild/${platform}) - - install(FILES "Microsoft.Cpp.Win32.LLVM-vs2010.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2010.targets") - install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012.targets") - install(FILES "Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets" DESTINATION "tools/msbuild/${platform}" RENAME "Microsoft.Cpp.${platform}.LLVM-vs2012_xp.targets") - install(FILES "toolset-vs2013.targets" DESTINATION "tools/msbuild/${platform}") - install(FILES "toolset-vs2013_xp.targets" DESTINATION "tools/msbuild/${platform}") - install(FILES "toolset-vs2014.targets" DESTINATION "tools/msbuild/${platform}") - install(FILES "toolset-vs2014_xp.targets" DESTINATION "tools/msbuild/${platform}") - endforeach() - - set(LIB_PATH_VERSION) - set(REG_KEY) - - install(DIRECTORY . - DESTINATION tools/msbuild - FILES_MATCHING - PATTERN "*.bat" - PATTERN ".svn" EXCLUDE - ) -endif() diff --git a/llvm/tools/msbuild/LLVM.Cpp.Common.props b/llvm/tools/msbuild/LLVM.Cpp.Common.props new file mode 100644 index 0000000..ffc1270 --- /dev/null +++ b/llvm/tools/msbuild/LLVM.Cpp.Common.props @@ -0,0 +1,75 @@ + + + + + + true + false + + $(IntermediateOutputPath) + $(Configuration)\ + $(SolutionDir)$(Configuration)\ + $(IntDir) + WindowsLocalDebugger + + + + + <_PlatformToolsetShortNameFor_llvm>LLVM + <_PlatformToolsetFriendlyNameFor_llvm>LLVM + + + + + $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM@LLVM) + $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM@LLVM) + $(LLVMInstallDir)bin\clang-cl.exe + + + + + + + + $(IncludePath);$(VC_IncludePath);$(WindowsSDK_IncludePath); + $(WindowsSDK_MetadataPath); + $(VC_SourcePath); + + + + + + + + Default + + -m$(PlatformArchitecture) %(AdditionalOptions) + + + diff --git a/llvm/tools/msbuild/LLVM.Cpp.Common.targets b/llvm/tools/msbuild/LLVM.Cpp.Common.targets new file mode 100644 index 0000000..1edc08d --- /dev/null +++ b/llvm/tools/msbuild/LLVM.Cpp.Common.targets @@ -0,0 +1,184 @@ + + + + + + $(ClangClExecutable) + + + + + Project + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OldStyle + OldStyle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + diff --git a/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2010.targets b/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2010.targets deleted file mode 100644 index df41a84..0000000 --- a/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2010.targets +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012.targets b/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012.targets deleted file mode 100644 index f7432f2..0000000 --- a/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets b/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets deleted file mode 100644 index e8250d8..0000000 --- a/llvm/tools/msbuild/Microsoft.Cpp.Win32.LLVM-vs2012_xp.targets +++ /dev/null @@ -1,21 +0,0 @@ - - - - v4.0 - NoSupportCodeAnalysisXP;$(BeforeClCompileTargets) - - - - - - - - - - CheckWindowsSDK71A;$(PrepareForBuildDependsOn) - - - - - - diff --git a/llvm/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in b/llvm/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in deleted file mode 100644 index a775c31..0000000 --- a/llvm/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\@REG_KEY@) - $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\@REG_KEY@) - $(LLVMInstallDir)\msbuild-bin;$(ExecutablePath) - $(LLVMInstallDir)\lib\clang\@LIB_PATH_VERSION@\lib\windows;$(LibraryPath) - - - - - - -@mflag@ -fmsc-version=@MSC_VERSION@ %(AdditionalOptions) - - - diff --git a/llvm/tools/msbuild/Platformx64/Toolset.props b/llvm/tools/msbuild/Platformx64/Toolset.props new file mode 100644 index 0000000..4762f4e --- /dev/null +++ b/llvm/tools/msbuild/Platformx64/Toolset.props @@ -0,0 +1,11 @@ + + + + + $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH); + $(VC_ReferencesPath_x64); + $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x64); + $(VCToolsInstallDir)redist\Debug_NonRedist\x64 + + diff --git a/llvm/tools/msbuild/Platformx64/Toolset.targets b/llvm/tools/msbuild/Platformx64/Toolset.targets new file mode 100644 index 0000000..938e03b --- /dev/null +++ b/llvm/tools/msbuild/Platformx64/Toolset.targets @@ -0,0 +1,3 @@ + + + diff --git a/llvm/tools/msbuild/Platformx86/Toolset.props b/llvm/tools/msbuild/Platformx86/Toolset.props new file mode 100644 index 0000000..5a5cd6c --- /dev/null +++ b/llvm/tools/msbuild/Platformx86/Toolset.props @@ -0,0 +1,11 @@ + + + + + $(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH); + $(VC_ReferencesPath_x86); + $(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86 + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(MSBuild_ExecutablePath);$(VC_LibraryPath_x86); + $(VCToolsInstallDir)redist\Debug_NonRedist\x86 + + diff --git a/llvm/tools/msbuild/Platformx86/Toolset.targets b/llvm/tools/msbuild/Platformx86/Toolset.targets new file mode 100644 index 0000000..938e03b --- /dev/null +++ b/llvm/tools/msbuild/Platformx86/Toolset.targets @@ -0,0 +1,3 @@ + + + diff --git a/llvm/tools/msbuild/install.bat b/llvm/tools/msbuild/install.bat index 6e321e3..bbc8a74 100644 --- a/llvm/tools/msbuild/install.bat +++ b/llvm/tools/msbuild/install.bat @@ -1,123 +1,57 @@ -@echo off - -echo Installing MSVC integration... -set SUCCESS=0 - -REM Change to the directory of this batch file. -cd /d %~dp0 - -REM Loop over the two platforms in awkward batch file fashion. -set PLATFORM=None -:PLATFORMLOOPHEAD -IF %PLATFORM% == x64 GOTO PLATFORMLOOPEND -IF %PLATFORM% == Win32 SET PLATFORM=x64 -IF %PLATFORM% == None SET PLATFORM=Win32 - -REM Search for the MSBuild toolsets directory. - -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V100 -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V100 - -:TRY_V110 -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V110 -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V110 - -:TRY_V120 -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V120 -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V120 - -:TRY_V140 -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V140 -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D% GOTO FOUND_V140 - -:TRY_V150 - -GOTO PLATFORMLOOPHEAD - -:PLATFORMLOOPEND -IF %SUCCESS% == 1 goto DONE -echo Failed to find MSBuild toolsets directory. -goto FAILED - - -:FOUND_V100 -REM Routine for installing v100 toolchain. -IF NOT EXIST %D%\LLVM-vs2010 mkdir %D%\LLVM-vs2010 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.props %D%\LLVM-vs2010 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.targets %D%\LLVM-vs2010 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -set SUCCESS=1 -GOTO TRY_V110 - -:FOUND_V110 -REM Routine for installing v110 toolchain. -IF NOT EXIST %D%\LLVM-vs2012 mkdir %D%\LLVM-vs2012 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.props %D%\LLVM-vs2012 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.targets %D%\LLVM-vs2012 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -IF NOT EXIST %D%\LLVM-vs2012_xp mkdir %D%\LLVM-vs2012_xp -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.props %D%\LLVM-vs2012_xp -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.targets %D%\LLVM-vs2012_xp -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -set SUCCESS=1 -GOTO TRY_V120 - -:FOUND_V120 -REM Routine for installing v120 toolchain. -IF NOT EXIST %D%\LLVM-vs2013 mkdir %D%\LLVM-vs2013 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2013.props %D%\LLVM-vs2013\toolset.props -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2013.targets %D%\LLVM-vs2013\toolset.targets -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -IF NOT EXIST %D%\LLVM-vs2013_xp mkdir %D%\LLVM-vs2013_xp -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2013_xp.props %D%\LLVM-vs2013_xp\toolset.props -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2013_xp.targets %D%\LLVM-vs2013_xp\toolset.targets -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -set SUCCESS=1 -GOTO TRY_V140 - -:FOUND_V140 -REM Routine for installing v140 toolchain. -IF NOT EXIST %D%\LLVM-vs2014 mkdir %D%\LLVM-vs2014 -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2014.props %D%\LLVM-vs2014\toolset.props -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2014.targets %D%\LLVM-vs2014\toolset.targets -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -IF NOT EXIST %D%\LLVM-vs2014_xp mkdir %D%\LLVM-vs2014_xp -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2014_xp.props %D%\LLVM-vs2014_xp\toolset.props -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -copy %PLATFORM%\toolset-vs2014_xp.targets %D%\LLVM-vs2014_xp\toolset.targets -IF NOT %ERRORLEVEL% == 0 GOTO FAILED -set SUCCESS=1 -GOTO TRY_V150 - - -:DONE -echo Done! -goto END - -:FAILED -echo MSVC integration install failed. -pause -goto END - -:END +@echo off + +echo Installing MSVC integration... +set SUCCESS=0 + +REM In general this script should not be used except for development and testing +REM purposes. The proper way to install is via the VSIX, and the proper way to +REM uninstall is through the Visual Studio extension manager. + +REM Change to the directory of this batch file. +cd /d %~dp0 + +REM Older versions of VS would look for these files in the Program Files\MSBuild directory +REM but with VS2017 it seems to look for these directly in the Visual Studio instance. +REM This means we'll need to do a little extra work to properly detect all the various +REM instances, but in reality we can probably sidestep all of this by just wrapping this +REM in a vsix and calling it a day, as that should handle everything for us. +SET VCTargets=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets + +ECHO Installing Common Files +copy LLVM.Cpp.Common.props "%VCTargets%" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED +copy LLVM.Cpp.Common.targets "%VCTargets%" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED + +ECHO Installing x64 Platform Toolset +SET PlatformToolsets=%VCTargets%\Platforms\x64\PlatformToolsets +IF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED +copy PlatformX64\Toolset.props "%PlatformToolsets%\llvm" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED +copy PlatformX64\Toolset.targets "%PlatformToolsets%\llvm" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED + +ECHO Installing Win32 Platform Toolset +SET PlatformToolsets=%VCTargets%\Platforms\Win32\PlatformToolsets +IF NOT EXIST "%PlatformToolsets%\llvm" mkdir "%PlatformToolsets%\llvm" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED +copy PlatformX86\Toolset.props "%PlatformToolsets%\llvm" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED +copy PlatformX86\Toolset.targets "%PlatformToolsets%\llvm" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED + +ECHO Installing C++ Settings UI +copy llvm-general.xml "%VCTargets%\1033" +IF NOT %ERRORLEVEL% == 0 GOTO FAILED + +:DONE +echo Done! +goto END + +:FAILED +echo MSVC integration install failed. +pause +goto END + +:END diff --git a/llvm/tools/msbuild/license.txt b/llvm/tools/msbuild/license.txt new file mode 100644 index 0000000..76aa2af --- /dev/null +++ b/llvm/tools/msbuild/license.txt @@ -0,0 +1,39 @@ +==================== +LLVM Release License +==================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2007-2018 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at Urbana-Champaign, nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + +==================== +The LLVM software contains code written by third parties. Such software will have its own individual LICENSE.TXT file in the directory in which it appears. This file will describe the copyrights, license, and restrictions which apply +to that code. + +The disclaimer of warranty in the University of Illinois Open Source License applies to all code in the LLVM Distribution, and nothing in any of the other licenses gives permission to use the names of the LLVM Team or the University of Illinois to endorse or promote products derived from this Software. + +The following pieces of software have additional or alternate copyrights, licenses, and/or restrictions: + +Program Directory +------- --------- + + diff --git a/llvm/tools/msbuild/llvm-general.xml b/llvm/tools/msbuild/llvm-general.xml new file mode 100644 index 0000000..6faf911 --- /dev/null +++ b/llvm/tools/msbuild/llvm-general.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + diff --git a/llvm/tools/msbuild/llvm.csproj b/llvm/tools/msbuild/llvm.csproj new file mode 100644 index 0000000..a614bb2 --- /dev/null +++ b/llvm/tools/msbuild/llvm.csproj @@ -0,0 +1,100 @@ + + + + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + Debug + AnyCPU + 2.0 + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {62530D9E-1B24-4C31-8DC9-AE47E9E5DC53} + Library + Properties + llvm + llvm + v4.6.1 + false + false + false + false + false + false + Program + $(DevEnvDir)devenv.exe + /rootsuffix Exp + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + true + VCTargets + 1033 + + + true + VCTargets + + + Always + true + + + true + VCTargets + + + Designer + + + true + VCTargets + Platforms\x64\PlatformToolsets\llvm + + + true + VCTargets + Platforms\x64\PlatformToolsets\llvm + + + true + VCTargets + Platforms\Win32\PlatformToolsets\llvm + + + true + VCTargets + Platforms\Win32\PlatformToolsets\llvm + + + + + + + + + \ No newline at end of file diff --git a/llvm/tools/msbuild/llvm.sln b/llvm/tools/msbuild/llvm.sln new file mode 100644 index 0000000..9fc3744 --- /dev/null +++ b/llvm/tools/msbuild/llvm.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2006 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "llvm", "llvm.csproj", "{62530D9E-1B24-4C31-8DC9-AE47E9E5DC53}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {62530D9E-1B24-4C31-8DC9-AE47E9E5DC53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62530D9E-1B24-4C31-8DC9-AE47E9E5DC53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62530D9E-1B24-4C31-8DC9-AE47E9E5DC53}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62530D9E-1B24-4C31-8DC9-AE47E9E5DC53}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BD0FC803-C28B-4327-A129-CFB35C873897} + EndGlobalSection +EndGlobal diff --git a/llvm/tools/msbuild/source.extension.vsixmanifest b/llvm/tools/msbuild/source.extension.vsixmanifest new file mode 100644 index 0000000..28be6a4 --- /dev/null +++ b/llvm/tools/msbuild/source.extension.vsixmanifest @@ -0,0 +1,22 @@ + + + + + LLVM Compiler Toolchain + Allows the LLVM Compiler Toolchain (installed separately) to be used from within Visual Studio to build C/C++ Projects. + license.txt + + + + + + + + + + + + + + + diff --git a/llvm/tools/msbuild/toolset-vs2013.targets b/llvm/tools/msbuild/toolset-vs2013.targets deleted file mode 100644 index a6efac4..0000000 --- a/llvm/tools/msbuild/toolset-vs2013.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/llvm/tools/msbuild/toolset-vs2013_xp.targets b/llvm/tools/msbuild/toolset-vs2013_xp.targets deleted file mode 100644 index e719681..0000000 --- a/llvm/tools/msbuild/toolset-vs2013_xp.targets +++ /dev/null @@ -1,21 +0,0 @@ - - - - v4.0 - NoSupportCodeAnalysisXP;$(BeforeClCompileTargets) - - - - - - - - - - CheckWindowsSDK71A;$(PrepareForBuildDependsOn) - - - - - - diff --git a/llvm/tools/msbuild/toolset-vs2014.targets b/llvm/tools/msbuild/toolset-vs2014.targets deleted file mode 100644 index 05b59a2..0000000 --- a/llvm/tools/msbuild/toolset-vs2014.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/llvm/tools/msbuild/toolset-vs2014_xp.targets b/llvm/tools/msbuild/toolset-vs2014_xp.targets deleted file mode 100644 index eec4f18..0000000 --- a/llvm/tools/msbuild/toolset-vs2014_xp.targets +++ /dev/null @@ -1,21 +0,0 @@ - - - - v4.0 - NoSupportCodeAnalysisXP;$(BeforeClCompileTargets) - - - - - - - - - - CheckWindowsSDK71A;$(PrepareForBuildDependsOn) - - - - - - diff --git a/llvm/tools/msbuild/uninstall.bat b/llvm/tools/msbuild/uninstall.bat index c1afae2..0c8852e 100644 --- a/llvm/tools/msbuild/uninstall.bat +++ b/llvm/tools/msbuild/uninstall.bat @@ -1,73 +1,33 @@ -@echo off - -echo Uninstalling MSVC integration... - -REM CD to the directory of this batch file. -cd /d %~dp0 - -set PLATFORM=None -:LOOPHEAD -IF %PLATFORM% == x64 GOTO LOOPEND -IF %PLATFORM% == Win32 SET PLATFORM=x64 -IF %PLATFORM% == None SET PLATFORM=Win32 - - -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.props -IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.targets -IF EXIST %D%\LLVM-vs2010 rmdir %D%\LLVM-vs2010 -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.props -IF EXIST %D%\LLVM-vs2010 del %D%\LLVM-vs2010\Microsoft.Cpp.%PLATFORM%.LLVM-vs2010.targets -IF EXIST %D%\LLVM-vs2010 rmdir %D%\LLVM-vs2010 - -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.props -IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.targets -IF EXIST %D%\LLVM-vs2012 rmdir %D%\LLVM-vs2012 -IF EXIST %D%\LLVM-vs2012_xp del %D%\LLVM-vs2012_xp\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.props -IF EXIST %D%\LLVM-vs2012_xp del %D%\LLVM-vs2012_xp\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.targets -IF EXIST %D%\LLVM-vs2012_xp rmdir %D%\LLVM-vs2012_xp -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.props -IF EXIST %D%\LLVM-vs2012 del %D%\LLVM-vs2012\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012.targets -IF EXIST %D%\LLVM-vs2012 rmdir %D%\LLVM-vs2012 -IF EXIST %D%\LLVM-vs2012_xp del %D%\LLVM-vs2012_xp\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.props -IF EXIST %D%\LLVM-vs2012_xp del %D%\LLVM-vs2012_xp\Microsoft.Cpp.%PLATFORM%.LLVM-vs2012_xp.targets -IF EXIST %D%\LLVM-vs2012_xp rmdir %D%\LLVM-vs2012_xp - -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2013 del %D%\LLVM-vs2013\toolset.props -IF EXIST %D%\LLVM-vs2013 del %D%\LLVM-vs2013\toolset.targets -IF EXIST %D%\LLVM-vs2013 rmdir %D%\LLVM-vs2013 -IF EXIST %D%\LLVM-vs2013_xp del %D%\LLVM-vs2013_xp\toolset.props -IF EXIST %D%\LLVM-vs2013_xp del %D%\LLVM-vs2013_xp\toolset.targets -IF EXIST %D%\LLVM-vs2013_xp rmdir %D%\LLVM-vs2013_xp -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2013 del %D%\LLVM-vs2013\toolset.props -IF EXIST %D%\LLVM-vs2013 del %D%\LLVM-vs2013\toolset.targets -IF EXIST %D%\LLVM-vs2013 rmdir %D%\LLVM-vs2013 -IF EXIST %D%\LLVM-vs2013_xp del %D%\LLVM-vs2013_xp\toolset.props -IF EXIST %D%\LLVM-vs2013_xp del %D%\LLVM-vs2013_xp\toolset.targets -IF EXIST %D%\LLVM-vs2013_xp rmdir %D%\LLVM-vs2013_xp - -SET D="%ProgramFiles%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.props -IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.targets -IF EXIST %D%\LLVM-vs2014 rmdir %D%\LLVM-vs2014 -IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.props -IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.targets -IF EXIST %D%\LLVM-vs2014_xp rmdir %D%\LLVM-vs2014_xp -SET D="%ProgramFiles(x86)%\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\%PLATFORM%\PlatformToolsets" -IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.props -IF EXIST %D%\LLVM-vs2014 del %D%\LLVM-vs2014\toolset.targets -IF EXIST %D%\LLVM-vs2014 rmdir %D%\LLVM-vs2014 -IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.props -IF EXIST %D%\LLVM-vs2014_xp del %D%\LLVM-vs2014_xp\toolset.targets -IF EXIST %D%\LLVM-vs2014_xp rmdir %D%\LLVM-vs2014_xp - - -GOTO LOOPHEAD - -:LOOPEND -echo Done! +@echo off + +echo Uninstalling MSVC integration... + +REM In general this script should not be used except for development and testing +REM purposes. The proper way to install is via the VSIX, and the proper way to +REM uninstall is through the Visual Studio extension manager. + +REM CD to the directory of this batch file. +cd /d %~dp0 + +SET VCTargets=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets + +ECHO Uninstalling Common Files +IF EXIST "%VCTargets%\LLVM.Cpp.Common.props" del "%VCTargets%\LLVM.Cpp.Common.props" +IF EXIST "%VCTargets%\LLVM.Cpp.Common.targets" del "%VCTargets%\LLVM.Cpp.Common.targets" + +ECHO Uninstalling x64 Platform Toolset +SET PlatformToolsets=%VCTargets%\Platforms\x64\PlatformToolsets +IF EXIST "%PlatformToolsets%\llvm\Toolset.props" del "%PlatformToolsets%\llvm\Toolset.props" +IF EXIST "%PlatformToolsets%\llvm\Toolset.targets" del "%PlatformToolsets%\llvm\Toolset.targets" +IF EXIST "%PlatformToolsets%\llvm" rd "%PlatformToolsets%\llvm" + +ECHO Uninstalling Win32 Platform Toolset +SET PlatformToolsets=%VCTargets%\Platforms\Win32\PlatformToolsets +IF EXIST "%PlatformToolsets%\llvm\Toolset.props" del "%PlatformToolsets%\llvm\Toolset.props" +IF EXIST "%PlatformToolsets%\llvm\Toolset.targets" del "%PlatformToolsets%\llvm\Toolset.targets" +IF EXIST "%PlatformToolsets%\llvm" rd "%PlatformToolsets%\llvm" + +ECHO Uninstalling C++ Settings UI +IF EXIST "%VCTargets%\1033\llvm-general.xml" del "%VCTargets%\1033\llvm-general.xml" + +echo Done! -- 2.7.4