Skip to content

Commit 8e442b3

Browse files
dgg5503vvereschaka
authored andcommitted
[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
1 parent 52ce95a commit 8e442b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/cmake/modules/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ extend_path(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}" "${LLVM_TOOLS
135135

136136
# Generate a default location for lit
137137
if (LLVM_INSTALL_UTILS AND LLVM_BUILD_UTILS)
138-
set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit")
138+
if (CMAKE_HOST_WIN32 AND NOT CYGWIN)
139+
set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit.py")
140+
else()
141+
set(LLVM_CONFIG_DEFAULT_EXTERNAL_LIT "${LLVM_CONFIG_TOOLS_BINARY_DIR}/llvm-lit")
142+
endif()
139143
endif()
140144

141145
get_config_exports_includes(LLVM LLVM_CONFIG_INCLUDE_EXPORTS)

0 commit comments

Comments
 (0)