[PATCH] D18497: Auto-install LLVM Visual Studio visualizers for VS2015 and up

Mike Spertus via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 27 09:04:46 PDT 2016


mspertus updated this revision to Diff 51740.
mspertus added a comment.

Missed one (the missing period in llvm.natvis).


http://reviews.llvm.org/D18497

Files:
  CMakeLists.txt
  utils/llvm.natvis

Index: utils/llvm.natvis
===================================================================
--- utils/llvm.natvis
+++ utils/llvm.natvis
@@ -1,9 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-Visual Studio 2012 Native Debugging Visualizers for LLVM
+Visual Studio Native Debugging Visualizers for LLVM
 
-Put this file into "%USERPROFILE%\Documents\Visual Studio 2012\Visualizers"
-or create a symbolic link so it updates automatically.
+For Visual Studio 2013 only, put this file into 
+"%USERPROFILE%\Documents\Visual Studio 2013\Visualizers" or create a symbolic link so it updates automatically.
+
+For later versions of Visual Studio, no setup is required.
 -->
 <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
 
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -398,6 +398,12 @@
   set(LLVM_USE_HOST_TOOLS ON)
 endif()
 
+if (MSVC_IDE AND NOT (MSVC_VERSION LESS 1900))
+  option(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION "Configure project to use Visual Studio native visualizers" TRUE)
+else()
+  set(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION FALSE CACHE INTERNAL "For Visual Studio 2013, manually copy natvis files to Documents\\Visual Studio 2013\\Visualizers" FORCE)
+endif()
+
 # All options referred to from HandleLLVMOptions have to be specified
 # BEFORE this include, otherwise options will not be correctly set on
 # first cmake run
@@ -728,6 +734,14 @@
 
 add_subdirectory(cmake/modules)
 
+# Do this by hand instead of using add_llvm_utilities(), which
+# tries to create a corresponding executable, which we don't want
+if (LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION)
+  set(LLVM_VISUALIZERS utils/llvm.natvis)
+  add_custom_target(LLVMVisualizers SOURCES ${LLVM_VISUALIZERS})
+  set_target_properties(LLVMVisualizers PROPERTIES FOLDER "Utils")
+endif()
+
 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   install(DIRECTORY include/llvm include/llvm-c
     DESTINATION include


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18497.51740.patch
Type: text/x-patch
Size: 2006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160327/1e2108be/attachment.bin>


More information about the cfe-commits mailing list