summaryrefslogtreecommitdiff
path: root/utils/llvm-lit/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'utils/llvm-lit/CMakeLists.txt')
-rw-r--r--utils/llvm-lit/CMakeLists.txt25
1 files changed, 21 insertions, 4 deletions
diff --git a/utils/llvm-lit/CMakeLists.txt b/utils/llvm-lit/CMakeLists.txt
index b535eaecde7d..4b10354cfdea 100644
--- a/utils/llvm-lit/CMakeLists.txt
+++ b/utils/llvm-lit/CMakeLists.txt
@@ -1,4 +1,21 @@
-configure_file(
- llvm-lit.in
- ${LLVM_TOOLS_BINARY_DIR}/llvm-lit
- )
+if (WIN32 AND NOT CYGWIN)
+ # llvm-lit needs suffix.py for multiprocess to find a main module.
+ set(suffix .py)
+endif ()
+set(llvm_lit_path ${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lit${suffix})
+
+if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
+ foreach(BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${BUILD_MODE} bi ${llvm_lit_path})
+ configure_file(
+ llvm-lit.in
+ ${bi}
+ )
+ endforeach()
+else()
+ set(BUILD_MODE .)
+ configure_file(
+ llvm-lit.in
+ ${llvm_lit_path}
+ )
+endif()