[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
Wed Aug 21 06:26:27 PDT 2024
================
@@ -839,20 +841,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 (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)
- set(LLVM_BUILD_LLVM_DYLIB_default OFF)
- if(LLVM_LINK_LLVM_DYLIB OR LLVM_BUILD_LLVM_C_DYLIB)
- set(LLVM_BUILD_LLVM_DYLIB_default ON)
- endif()
- option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default})
+endif()
+
+set(CAN_BUILD_LLVM_DYLIB OFF)
+if(NOT MSVC OR LLVM_BUILD_LLVM_DYLIB_VIS)
----------------
fsfod wrote:
Its a temporary option to allow testing the build with explicit visibility on Windows and Linux the idea is it will go away in the end, when I've gotten all my changes merged. It has to be separate from LLVM_BUILD_LLVM_DYLIB because there will be linker errors from symbols not exported when building llvm tools until the whole llvm codebase has export visibility macros added to it.
The idea was it was not a publicly defined option so people don't try use and submit bug reports against it. If you want I can publicly define it with a don't use for testing purposes only description.
https://github.com/llvm/llvm-project/pull/96630
More information about the llvm-commits
mailing list