[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
Thu Aug 8 06:32:43 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:

cmake_dependent_option seems to require all conditions be true while i need an OR, the Condition Syntax note on that page seems to imply i could put parentheses around an OR expression, but the minimum version for it is higher than LLVM's.

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


More information about the llvm-commits mailing list