[PATCH] [CMake] Fix MinGW cross-compilation
Akihiko Odaki via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 19 05:18:06 PDT 2016
WIN32 variable is not set when cross-compiling. This changes to check also
MINGW variable, which is set also in such cases.
---
cmake/modules/HandleLLVMOptions.cmake | 6 +++++-
lib/Transforms/Hello/CMakeLists.txt | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cmake/modules/HandleLLVMOptions.cmake
b/cmake/modules/HandleLLVMOptions.cmake
index 0268548..e0bd5e9 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -75,7 +75,11 @@ if(WIN32)
set(LLVM_ON_WIN32 1)
set(LLVM_ON_UNIX 0)
endif(CYGWIN)
-else(WIN32)
+elseif(MINGW)
+ set(LLVM_HAVE_LINK_VERSION_SCRIPT 0)
+ set(LLVM_ON_WIN32 1)
+ set(LLVM_ON_UNIX 0)
+else()
if(UNIX)
set(LLVM_ON_WIN32 0)
set(LLVM_ON_UNIX 1)
diff --git a/lib/Transforms/Hello/CMakeLists.txt
b/lib/Transforms/Hello/CMakeLists.txt
index 4a55dd9..5774d55 100644
--- a/lib/Transforms/Hello/CMakeLists.txt
+++ b/lib/Transforms/Hello/CMakeLists.txt
@@ -6,7 +6,7 @@ if( NOT LLVM_REQUIRES_RTTI )
endif()
endif()
-if(WIN32 OR CYGWIN)
+if(WIN32 OR CYGWIN OR MINGW)
set(LLVM_LINK_COMPONENTS Core Support)
endif()
-- 2.9.3
More information about the llvm-commits
mailing list