utils/llvm-lit: Generate "llvm-lit.py" rather than "llvm-lit" on Win32 hosts to let...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 3 Dec 2013 23:22:18 +0000 (23:22 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Tue, 3 Dec 2013 23:22:18 +0000 (23:22 +0000)
llvm-lit needs suffix.py for multiprocess to find a main module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196328 91177308-0d34-0410-b5e6-96231b3b80d8

utils/llvm-lit/CMakeLists.txt
utils/llvm-lit/Makefile

index b535eaecde7d41aa92f7300466ebeff8357bd174..585753427ac4b59a16582141ab9c721a6a33468f 100644 (file)
@@ -1,4 +1,9 @@
+if (WIN32 AND NOT CYGWIN)
+  # llvm-lit needs suffix.py for multiprocess to find a main module.
+  set(suffix .py)
+endif ()
+
 configure_file(
   llvm-lit.in
-  ${LLVM_TOOLS_BINARY_DIR}/llvm-lit
+  ${LLVM_TOOLS_BINARY_DIR}/llvm-lit${suffix}
   )
index 77021bbc2436cf9a15312c9d427b1e5db727a054..ce1cac9c32e9060487d9480515d41d18cfb9fbcc 100644 (file)
@@ -11,9 +11,14 @@ LEVEL = ../..
 
 include $(LEVEL)/Makefile.common
 
-all:: $(ToolDir)/llvm-lit
+# llvm-lit needs suffix.py for multiprocess to find a main module.
+ifeq ($(HOST_OS),MingW)
+  Suffix := .py
+endif
 
-$(ToolDir)/llvm-lit: llvm-lit.in Makefile $(ToolDir)/.dir
+all:: $(ToolDir)/llvm-lit$(Suffix)
+
+$(ToolDir)/llvm-lit$(Suffix): llvm-lit.in Makefile $(ToolDir)/.dir
        $(Echo) "Creating 'llvm-lit' script..."
        $(Verb)$(ECHOPATH) s=@LLVM_SOURCE_DIR@=$(LLVM_SRC_ROOT)=g > lit.tmp
        $(Verb)$(ECHOPATH) s=@LLVM_BINARY_DIR@=$(LLVM_OBJ_ROOT)=g >> lit.tmp