[PATCH] D77561: Check LLVM_BUILD_LLVM_C_DYLIB before building the C DLL with MSVC

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 09:12:05 PDT 2020


aaron.ballman created this revision.
aaron.ballman added a reviewer: xbolva00.
Herald added a subscriber: mgorny.

I think this may have been an oversight when the functionality originally landed, but it seems there is no other way to disable building the LLVM C bindings with MSVC without this change. I freely admit this is not my area of expertise though.

FWIW, I need this functionality because `llvm-nm` does not appear to work properly in Debug builds on Windows (executing `gen-msvc-exports.py` runs `llvm-nm` which fails because it doesn't understand any command line arguments due to crashing) and I needed a workaround to be able to build again.


https://reviews.llvm.org/D77561

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


Index: llvm/tools/llvm-shlib/CMakeLists.txt
===================================================================
--- llvm/tools/llvm-shlib/CMakeLists.txt
+++ llvm/tools/llvm-shlib/CMakeLists.txt
@@ -106,7 +106,7 @@
               " -compatibility_version 1 -current_version ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH} -Wl,-reexport_library ${LIB_PATH}")
 endif()
 
-if(MSVC)
+if(LLVM_BUILD_LLVM_C_DYLIB AND MSVC)
   # Build the LLVM-C.dll library that exports the C API.
 
   set(LLVM_LINK_COMPONENTS


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77561.255363.patch
Type: text/x-patch
Size: 522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200406/1a97aca8/attachment.bin>


More information about the llvm-commits mailing list