[llvm] 8e442b3 - [CMake] Ensure correct extension for llvm-lit is used on Windows when LLVM_INSTALL_UTILS is enabled.

Vladimir Vereschaka via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 28 20:44:03 PDT 2022


Author: Douglas Gliner
Date: 2022-04-28T20:41:47-07:00
New Revision: 8e442b341c3b0bfde2947170285e1580f0cde0d7

URL: https://github.com/llvm/llvm-project/commit/8e442b341c3b0bfde2947170285e1580f0cde0d7
DIFF: https://github.com/llvm/llvm-project/commit/8e442b341c3b0bfde2947170285e1580f0cde0d7.diff

LOG: [CMake] Ensure correct extension for llvm-lit is used on Windows when LLVM_INSTALL_UTILS is enabled.

D77110 initially added support for setting LLVM_CONFIG_DEFAULT_EXTERNAL_LIT
to llvm-lit in the install directory if LLVM_INSTALL_UTILS is on.

D79144 ensured that, on Windows, llvm-lit.py is correctly set for
LLVM_CONFIG_DEFAULT_EXTERNAL_LIT within the context of the build area,
however, it did not account for the install area which is the latter set
directive for this same variable.

This patch ensures that LLVM_CONFIG_DEFAULT_EXTERNAL_LIT under the install
area uses llvm-lit.py under Windows since llvm-lit without the extension
is not created.

Differential Revision: https://reviews.llvm.org/D124197

Added: 
    

Modified: 
    llvm/cmake/modules/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index cea0c1df0a14a..0a7d84fe1c9bd 100644
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -135,7 +135,11 @@ extend_path(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}" "${LLVM_TOOLS
 
 # Generate a default location for lit
 if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
-  set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit")
+  if (CMAKE_HOST_WIN32 AND NOT CYGWIN)
+    set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit.py")
+  else()
+    set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit")
+  endif()
 endif()
 
 get_config_exports_includes(LLVM LLVM_CONFIG_INCLUDE_EXPORTS)


        


More information about the llvm-commits mailing list