[PATCH] D11994: Doxygen: add build option to use svg instead of png files for graphs

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 14:50:35 PDT 2015


hans created this revision.
hans added a reviewer: logan.
hans added a subscriber: llvm-commits.

The doxygen output is currently not practical for shipping with releases, as it weighs in at about 1 GB when xz-compressed.

If we'd use svg instead of png for the diagrams, the output compresses to about 65 MB :-)

http://reviews.llvm.org/D11994

Files:
  docs/CMake.rst
  docs/CMakeLists.txt
  docs/Makefile
  docs/doxygen.cfg.in

Index: docs/doxygen.cfg.in
===================================================================
--- docs/doxygen.cfg.in
+++ docs/doxygen.cfg.in
@@ -2205,7 +2205,7 @@
 # The default value is: png.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOT_IMAGE_FORMAT       = png
+DOT_IMAGE_FORMAT       = @DOT_IMAGE_FORMAT@
 
 # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
 # enable generation of interactive SVG images that allow zooming and panning.
Index: docs/Makefile
===================================================================
--- docs/Makefile
+++ docs/Makefile
@@ -31,6 +31,7 @@
 	  -e 's/@llvm_doxygen_qhp_cust_filter_name@//g' \
 	  -e 's/@llvm_doxygen_qhp_namespace@//g' \
 	  -e 's/@searchengine_url@//g' \
+	  -e 's/@DOT_IMAGE_FORMAT@/png/g' \
 	  > $@
 endif
 
Index: docs/CMakeLists.txt
===================================================================
--- docs/CMakeLists.txt
+++ docs/CMakeLists.txt
@@ -56,6 +56,14 @@
     set(llvm_doxygen_qhp_cust_filter_attrs "")
   endif()
   
+  option(LLVM_DOXYGEN_SVG
+    "Use svg instead of png files for doxygen graphs." OFF)
+  if (LLVM_DOXYGEN_SVG)
+    set(DOT_IMAGE_FORMAT "svg")
+  else()
+    set(DOT_IMAGE_FORMAT "png")
+  endif()
+
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
     ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
 
@@ -73,6 +81,7 @@
   set(llvm_doxygen_qhelpgenerator_path)
   set(llvm_doxygen_qhp_cust_filter_name)
   set(llvm_doxygen_qhp_cust_filter_attrs)
+  set(DOT_IMAGE_FORMAT)
 
   add_custom_target(doxygen-llvm
     COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
Index: docs/CMake.rst
===================================================================
--- docs/CMake.rst
+++ docs/CMake.rst
@@ -387,6 +387,10 @@
   ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; otherwise this has no
   effect.
 
+**LLVM_DOXYGEN_SVG**:BOOL
+  Uses .svg files instead of .png files for graphs in the Doxygen output.
+  Defaults to OFF.
+
 **LLVM_ENABLE_SPHINX**:BOOL
   If enabled CMake will search for the ``sphinx-build`` executable and will make
   the ``SPHINX_OUTPUT_HTML`` and ``SPHINX_OUTPUT_MAN`` CMake options available.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11994.31987.patch
Type: text/x-patch
Size: 2181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150812/58e2a062/attachment.bin>


More information about the llvm-commits mailing list