OSDN Git Service

[cmake] Change WIN32 test to CMAKE_HOST_WIN32
authorFilipe Cabecinhas <me@filcab.net>
Fri, 29 Jun 2018 10:34:37 +0000 (10:34 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Fri, 29 Jun 2018 10:34:37 +0000 (10:34 +0000)
The test is about what can be run on the host, not the cmake target.
When cross-compiling (compiler-rt at least) on Windows, we end up with
lit being unable to run llvm-lit because it can't find the llvm-lit
module.

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

cmake/modules/AddLLVM.cmake

index 62a2cfc..2f88f58 100644 (file)
@@ -1283,7 +1283,7 @@ function(get_llvm_lit_path base_dir file_name)
   endif()
 
   set(lit_file_name "llvm-lit")
-  if (WIN32 AND NOT CYGWIN)
+  if (CMAKE_HOST_WIN32 AND NOT CYGWIN)
     # llvm-lit needs suffix.py for multiprocess to find a main module.
     set(lit_file_name "${lit_file_name}.py")
   endif ()