[llvm] Initial changes for llvm shared library build using explicit visibility annotations (PR #96630)

Thomas Fransham via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 16:46:22 PDT 2024


================
@@ -815,22 +815,36 @@ endif()
 
 if(MSVC)
   option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" ON)
-  # Set this variable to OFF here so it can't be set with a command-line
-  # argument.
-  set (LLVM_LINK_LLVM_DYLIB OFF)
+  if(NOT LLVM_BUILD_LLVM_DYLIB_VIS)
+    # Set this variable to OFF here so it can't be set with a command-line
+    # argument.
+    set (LLVM_LINK_LLVM_DYLIB OFF)
+  endif()
   if (BUILD_SHARED_LIBS)
     message(FATAL_ERROR "BUILD_SHARED_LIBS options is not supported on Windows.")
   endif()
-else()
-  option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
+ else()
   option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)
+endif()
+
+if(NOT MSVC OR LLVM_BUILD_LLVM_DYLIB_VIS)
+  option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
----------------
fsfod wrote:

I had made it unconditioned before, but i reverted it back to the original code to discourage people trying to use it and reporting bugs while it won't work correctly yet. I think that was part of the intent of earlier code being hardcoded to off earlier in the file https://github.com/llvm/llvm-project/blob/d286efeb1d0d3e135901dd07535cc68aed39a758/llvm/CMakeLists.txt#L844-L860

https://github.com/llvm/llvm-project/pull/96630


More information about the llvm-commits mailing list