If we want to export all lldb symbols (i.e LLDB_EXPORT_ALL_SYMBOLS=ON), we need to use default visibility for all LLDB libraries even if a global CMAKE_CXX_VISIBILITY_PRESET=hidden is present. In fact, there are cases in which a global llvm configuration wants CMAKE_CXX_VISIBILITY_PRESET as hidden but simultaneously LLDB_EXPORT_ALL_SYMBOLS=ON is also needed to be able to develop out-of-tree lldb plugins.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/cmake/modules/AddLLDB.cmake | ||
---|---|---|
173 | Other places uses if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") to check for non-windows, should that check be used here as well? Not sure what's consistent for the lldb codebase. |
lldb/cmake/modules/AddLLDB.cmake | ||
---|---|---|
173 | I initially thought that it might be fine just to check the compiler id, but better be safer gating the target OS as well. |
LGTM, and makes sense to me given that downstream users often want a build of LLVM with CMAKE_CXX_VISIBILITY_PRESET=hidden, but lldb should still be able to build/link/work in the presence of that (the LLDB driver and tools currently fail to link if LLVM is built CMAKE_CXX_VISIBILITY_PRESET=hidden).
lldb/cmake/modules/AddLLDB.cmake | ||
---|---|---|
175 | Rather than changing the compile options directly, can we change the CXX_VISIBILITY_PRESET property? set_target_properties((${name} PROPERTIES CXX_VISIBILITY_PRESET default) |
lldb/cmake/modules/AddLLDB.cmake | ||
---|---|---|
175 | Thanks @JDevlieghere , that works and is cleaner |
Other places uses if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") to check for non-windows, should that check be used here as well? Not sure what's consistent for the lldb codebase.