[PATCH] [Request, 5 lines] D25076: [cmake] Make LIT_COMMAND configurable and support more 'standard' names

Michał Górny via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 00:50:19 PDT 2016


mgorny created this revision.
mgorny added reviewers: garious, ddunbar, chandlerc.
mgorny added a subscriber: llvm-commits.
Herald added a subscriber: beanz.

Make LIT_COMMAND configurable and extend the default search to other common executable names 'lit.py' and 'lit', in order to increase uniformity between all LLVM projects and support using installed lit.

Making LIT_COMMAND a cache variable in case the source tree variant is used serves two purposes. Firstly, it increases uniformity between the two branches since find_program() implicitly makes LIT_COMMAND a cache variable. Secondly, it allows overriding the lit executable used to run the tests when the LLVM source tree is provided. Gentoo is planning to use this to use installed (and byte-compiled) lit instead of re-compiling it in every LLVM project.

Extending default search is meant to increase uniformity between different LLVM projects. The 'lit.py' name is already used by a few of them, and 'lit' is the name used by utils/lit/setup.py when installing.


https://reviews.llvm.org/D25076

Files:
  cmake/modules/AddLLVM.cmake


Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1084,9 +1084,10 @@
     list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR})
   endif ()
   if (LLVM_MAIN_SRC_DIR)
-    set (LIT_COMMAND ${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
+    set (LIT_COMMAND "${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py"
+         CACHE STRING "Command used to spawn llvm-lit")
   else()
-    find_program(LIT_COMMAND llvm-lit)
+    find_program(LIT_COMMAND llvm-lit lit.py lit)
   endif ()
   list(APPEND LIT_COMMAND ${LIT_ARGS})
   foreach(param ${ARG_PARAMS})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25076.72996.patch
Type: text/x-patch
Size: 701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160930/9972f106/attachment.bin>


More information about the llvm-commits mailing list