wallace updated this revision to Diff 510557.
wallace added a comment.

gate the target OS


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147453/new/

https://reviews.llvm.org/D147453

Files:
  lldb/cmake/modules/AddLLDB.cmake


Index: lldb/cmake/modules/AddLLDB.cmake
===================================================================
--- lldb/cmake/modules/AddLLDB.cmake
+++ lldb/cmake/modules/AddLLDB.cmake
@@ -165,6 +165,16 @@
   else()
     set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
   endif()
+
+  # 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.
+  if (LLDB_EXPORT_ALL_SYMBOLS)
+    if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND
+        CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
+      target_compile_options(${name} PRIVATE "-fvisibility=default")
+    endif()
+  endif()
 endfunction(add_lldb_library)
 
 function(add_lldb_executable name)


Index: lldb/cmake/modules/AddLLDB.cmake
===================================================================
--- lldb/cmake/modules/AddLLDB.cmake
+++ lldb/cmake/modules/AddLLDB.cmake
@@ -165,6 +165,16 @@
   else()
     set_target_properties(${name} PROPERTIES FOLDER "lldb libraries")
   endif()
+
+  # 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.
+  if (LLDB_EXPORT_ALL_SYMBOLS)
+    if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows" AND
+        CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
+      target_compile_options(${name} PRIVATE "-fvisibility=default")
+    endif()
+  endif()
 endfunction(add_lldb_library)
 
 function(add_lldb_executable name)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to