[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-01-19 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: xiaobai, labath, LLDB.
Herald added subscribers: teemperor, abidh, aheejin, mgorny.
Herald added a project: LLDB.

This patch introduces a new CMake macro `add_lldb_plugin_subdirectory` to be 
used by the plugins. It's similar to `add_lldb_tool_subdirectory` which makes 
it possible to disable certain tools at configuration time. With the new macro, 
the same is possible for plugins. The difference is that it includes the 
plugin's parent directory in the name as well, so that the variable is named 
`LDB_PLUGIN_SYMBOLFILE_PDF_BUILD` rather than `LDB_PLUGIN_PDB_BUILD`.

I've updated the macOS CMake cache to give an idea of what this looks like.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D73016

Files:
  lldb/cmake/caches/Apple-lldb-macOS.cmake
  lldb/cmake/modules/AddLLDB.cmake
  lldb/source/Plugins/ABI/CMakeLists.txt
  lldb/source/Plugins/Architecture/CMakeLists.txt
  lldb/source/Plugins/Disassembler/CMakeLists.txt
  lldb/source/Plugins/DynamicLoader/CMakeLists.txt
  lldb/source/Plugins/ExpressionParser/CMakeLists.txt
  lldb/source/Plugins/Instruction/CMakeLists.txt
  lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt
  lldb/source/Plugins/JITLoader/CMakeLists.txt
  lldb/source/Plugins/Language/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
  lldb/source/Plugins/LanguageRuntime/RenderScript/CMakeLists.txt
  lldb/source/Plugins/MemoryHistory/CMakeLists.txt
  lldb/source/Plugins/ObjectContainer/CMakeLists.txt
  lldb/source/Plugins/ObjectFile/CMakeLists.txt
  lldb/source/Plugins/OperatingSystem/CMakeLists.txt
  lldb/source/Plugins/Platform/CMakeLists.txt
  lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
  lldb/source/Plugins/Process/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt
  lldb/source/Plugins/StructuredData/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/CMakeLists.txt
  lldb/source/Plugins/SymbolVendor/CMakeLists.txt
  lldb/source/Plugins/SystemRuntime/CMakeLists.txt
  lldb/source/Plugins/UnwindAssembly/CMakeLists.txt

Index: lldb/source/Plugins/UnwindAssembly/CMakeLists.txt
===
--- lldb/source/Plugins/UnwindAssembly/CMakeLists.txt
+++ lldb/source/Plugins/UnwindAssembly/CMakeLists.txt
@@ -1,2 +1,2 @@
-add_subdirectory(InstEmulation)
-add_subdirectory(x86)
+add_lldb_plugin_subdirectory(InstEmulation)
+add_lldb_plugin_subdirectory(x86)
Index: lldb/source/Plugins/SystemRuntime/CMakeLists.txt
===
--- lldb/source/Plugins/SystemRuntime/CMakeLists.txt
+++ lldb/source/Plugins/SystemRuntime/CMakeLists.txt
@@ -1 +1 @@
-add_subdirectory(MacOSX)
+add_lldb_plugin_subdirectory(MacOSX)
Index: lldb/source/Plugins/SymbolVendor/CMakeLists.txt
===
--- lldb/source/Plugins/SymbolVendor/CMakeLists.txt
+++ lldb/source/Plugins/SymbolVendor/CMakeLists.txt
@@ -1,6 +1,6 @@
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
-  add_subdirectory(MacOSX)
+  add_lldb_plugin_subdirectory(MacOSX)
 endif()
 
-add_subdirectory(ELF)
-add_subdirectory(wasm)
+add_lldb_plugin_subdirectory(ELF)
+add_lldb_plugin_subdirectory(wasm)
Index: lldb/source/Plugins/SymbolFile/CMakeLists.txt
===
--- lldb/source/Plugins/SymbolFile/CMakeLists.txt
+++ lldb/source/Plugins/SymbolFile/CMakeLists.txt
@@ -1,5 +1,5 @@
-add_subdirectory(Breakpad)
-add_subdirectory(DWARF)
-add_subdirectory(Symtab)
-add_subdirectory(NativePDB)
-add_subdirectory(PDB)
+add_lldb_plugin_subdirectory(Breakpad)
+add_lldb_plugin_subdirectory(DWARF)
+add_lldb_plugin_subdirectory(Symtab)
+add_lldb_plugin_subdirectory(NativePDB)
+add_lldb_plugin_subdirectory(PDB)
Index: lldb/source/Plugins/StructuredData/CMakeLists.txt
===
--- lldb/source/Plugins/StructuredData/CMakeLists.txt
+++ lldb/source/Plugins/StructuredData/CMakeLists.txt
@@ -1,2 +1,2 @@
-add_subdirectory(DarwinLog)
+add_lldb_plugin_subdirectory(DarwinLog)
 
Index: lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt
===
--- lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt
+++ lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt
@@ -4,4 +4,4 @@
   LINK_LIBS
 lldbCore
 lldbInterpreter
-  )
\ No newline at end of file
+  )
Index: lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
===
--- lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
+++ lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
@@ -1,8 +1,8 @@
-add_subdirectory(None)
+add_lldb_plugin_subdirectory(None)

[Lldb-commits] [PATCH] D73016: [lldb/CMake] Make it possible to disable plugins at configuration time

2020-01-19 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

How does this deal with linking flags etc.? Your cmake cache disabled 
`LLDB_PLUGIN_SYMBOLFILE_NATIVEPDB_BUILD` (well, it would without the LDB typo) 
but that just gives me a build that fails to link with `ld: error: unable to 
find library -llldbPluginSymbolFileNativePDB`.

Do we want to deal with dependencies between plugins? E.g. Language/CPlusPlus 
depending on Language/ClangCommon, so will CPlusPlus disabled too if I disable 
ClangCommon?




Comment at: lldb/cmake/caches/Apple-lldb-macOS.cmake:21
+# Disable platform plugins.
+set(LDB_PLUGIN_PLATFORM_ANDROID_BUILD OFF CACHE BOOL "")
+set(LDB_PLUGIN_PLATFORM_FREEBSD_BUILD OFF CACHE BOOL "")

`LDB` -> `LLDB` (here and in your description).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D73016



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits