[PATCH] D73156: [clang] Build clang-shlib on mingw

Valentin Churavy via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 21 19:13:46 PST 2020


vchuravy created this revision.
Herald added subscribers: cfe-commits, mstorsjo, mgorny.
Herald added a project: clang.
vchuravy added a reviewer: tstellar.
vchuravy added a comment.

Some additional context. We [Julia] is cross-compiling LLVM from Linux to mingw32
as part of an automatic buildsystem for our binary dependencies. The corresponding PR is https://github.com/JuliaPackaging/Yggdrasil/pull/417


Currently we exclude the libclang-cpp cmake files
on any non-unix platform, this excludes mingw32.

I suspect that the goal was to exclude MSVC only.
For the LLVM shlib we throw an error if someone tries
to build the shared library, whereas I stuck to the pattern
here that a misconfiguration causes an early return.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73156

Files:
  clang/tools/CMakeLists.txt
  clang/tools/clang-shlib/CMakeLists.txt


Index: clang/tools/clang-shlib/CMakeLists.txt
===================================================================
--- clang/tools/clang-shlib/CMakeLists.txt
+++ clang/tools/clang-shlib/CMakeLists.txt
@@ -3,6 +3,11 @@
   return()
 endif()
 
+# Building libclang-cpp.so may not work on MSVC
+if (MSVC)
+  return()
+endif()
+
 get_property(clang_libs GLOBAL PROPERTY CLANG_STATIC_LIBS)
 
 foreach (lib ${clang_libs})
Index: clang/tools/CMakeLists.txt
===================================================================
--- clang/tools/CMakeLists.txt
+++ clang/tools/CMakeLists.txt
@@ -15,9 +15,7 @@
 
 add_clang_subdirectory(clang-rename)
 add_clang_subdirectory(clang-refactor)
-if(UNIX)
-  add_clang_subdirectory(clang-shlib)
-endif()
+add_clang_subdirectory(clang-shlib)
 
 if(CLANG_ENABLE_ARCMT)
   add_clang_subdirectory(arcmt-test)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73156.239478.patch
Type: text/x-patch
Size: 835 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200122/453f94dc/attachment.bin>


More information about the cfe-commits mailing list