[PATCH] D52819: Support checking out cte to 'extra' only as backward compatibility

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 00:51:11 PDT 2018


steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added subscribers: cfe-commits, mgorny.

This requirement to check it out in a directory called 'extra' was never
documented for git users, so git users doing the obvious thing (just
clone, don't specify a name) will silently not get clang-tools-extra
built.

Even reading the code is confusing because the
`add_llvm_external_project` macro appears to be used in place of the
`add_subdirectory` command, though the latter treats the second
placement argument as just a build directory name.  So, anyone assuming
the same semantic with `add_llvm_external_project` would be confused.


Repository:
  rC Clang

https://reviews.llvm.org/D52819

Files:
  tools/CMakeLists.txt
  www/get_started.html


Index: www/get_started.html
===================================================================
--- www/get_started.html
+++ www/get_started.html
@@ -66,7 +66,7 @@
   <ul>
     <li><tt>cd llvm/tools/clang/tools</tt></li>
     <li><tt>svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk
-        extra</tt></li>
+        clang-tools-extra</tt></li>
     <li><tt>cd ../../../..</tt></li>
   </ul>
   </li>
Index: tools/CMakeLists.txt
===================================================================
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -26,12 +26,17 @@
   add_clang_subdirectory(scan-view)
 endif()
 
-# We support checking out the clang-tools-extra repository into the 'extra'
-# subdirectory. It contains tools developed as part of the Clang/LLVM project
-# on top of the Clang tooling platform. We keep them in a separate repository
-# to keep the primary Clang repository small and focused.
-# It also may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.
-add_llvm_external_project(clang-tools-extra extra)
+if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/extra)
+
+    # Documentation for working with SVN used to recommend using
+    # the name 'extra'.  Support that for now as backwards
+    # compatibility
+    message(DEPRECATION "Checking out clang-tools-extra into a directory called 'extra' is deprecated.
+Rename the directory to 'clang-tools-extra' instead.")
+    add_llvm_external_project(clang-tools-extra extra)
+else()
+    add_llvm_external_project(clang-tools-extra)
+endif()
 
 # libclang may require clang-tidy in clang-tools-extra.
 add_clang_subdirectory(libclang)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52819.168075.patch
Type: text/x-patch
Size: 1628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181003/d18f9b50/attachment.bin>


More information about the cfe-commits mailing list