bulbazord created this revision.
bulbazord added a reviewer: JDevlieghere.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Non-plugin lldb libraries should generally not be linking against lldb
plugin libraries. Enforce this in CMake.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D146553
Files:
lldb/cmake/modules/AddLLDB.cmake
lldb/source/Breakpoint/CMakeLists.txt
lldb/source/Commands/CMakeLists.txt
lldb/source/Core/CMakeLists.txt
lldb/source/DataFormatters/CMakeLists.txt
lldb/source/Expression/CMakeLists.txt
lldb/source/Host/CMakeLists.txt
lldb/source/Host/macosx/objcxx/CMakeLists.txt
lldb/source/Interpreter/CMakeLists.txt
lldb/source/Symbol/CMakeLists.txt
lldb/source/Target/CMakeLists.txt
lldb/source/Version/CMakeLists.txt
Index: lldb/source/Version/CMakeLists.txt
===================================================================
--- lldb/source/Version/CMakeLists.txt
+++ lldb/source/Version/CMakeLists.txt
@@ -36,7 +36,7 @@
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-add_lldb_library(lldbVersion
+add_lldb_library(lldbVersion NO_PLUGIN_DEPENDENCIES
Version.cpp
${vcs_version_inc}
${version_inc})
Index: lldb/source/Target/CMakeLists.txt
===================================================================
--- lldb/source/Target/CMakeLists.txt
+++ lldb/source/Target/CMakeLists.txt
@@ -6,7 +6,7 @@
SOURCE TargetProperties.td
TARGET LLDBTargetPropertiesEnumGen)
-add_lldb_library(lldbTarget
+add_lldb_library(lldbTarget NO_PLUGIN_DEPENDENCIES
ABI.cpp
AssertFrameRecognizer.cpp
DynamicRegisterInfo.cpp
Index: lldb/source/Symbol/CMakeLists.txt
===================================================================
--- lldb/source/Symbol/CMakeLists.txt
+++ lldb/source/Symbol/CMakeLists.txt
@@ -6,7 +6,7 @@
)
endif()
-add_lldb_library(lldbSymbol
+add_lldb_library(lldbSymbol NO_PLUGIN_DEPENDENCIES
ArmUnwindInfo.cpp
Block.cpp
CompactUnwindInfo.cpp
Index: lldb/source/Interpreter/CMakeLists.txt
===================================================================
--- lldb/source/Interpreter/CMakeLists.txt
+++ lldb/source/Interpreter/CMakeLists.txt
@@ -6,7 +6,7 @@
SOURCE InterpreterProperties.td
TARGET LLDBInterpreterPropertiesEnumGen)
-add_lldb_library(lldbInterpreter
+add_lldb_library(lldbInterpreter NO_PLUGIN_DEPENDENCIES
CommandAlias.cpp
CommandHistory.cpp
CommandInterpreter.cpp
Index: lldb/source/Host/macosx/objcxx/CMakeLists.txt
===================================================================
--- lldb/source/Host/macosx/objcxx/CMakeLists.txt
+++ lldb/source/Host/macosx/objcxx/CMakeLists.txt
@@ -2,7 +2,7 @@
remove_module_flags()
include_directories(..)
-add_lldb_library(lldbHostMacOSXObjCXX
+add_lldb_library(lldbHostMacOSXObjCXX NO_PLUGIN_DEPENDENCIES
Host.mm
HostInfoMacOSX.mm
HostThreadMacOSX.mm
Index: lldb/source/Host/CMakeLists.txt
===================================================================
--- lldb/source/Host/CMakeLists.txt
+++ lldb/source/Host/CMakeLists.txt
@@ -159,7 +159,7 @@
endif()
endif()
-add_lldb_library(lldbHost
+add_lldb_library(lldbHost NO_PLUGIN_DEPENDENCIES
${HOST_SOURCES}
LINK_LIBS
Index: lldb/source/Expression/CMakeLists.txt
===================================================================
--- lldb/source/Expression/CMakeLists.txt
+++ lldb/source/Expression/CMakeLists.txt
@@ -1,3 +1,4 @@
+# TODO: Add property `NO_PLUGIN_DEPENDENCIES` to lldbExpression
add_lldb_library(lldbExpression
DiagnosticManager.cpp
DWARFExpression.cpp
Index: lldb/source/DataFormatters/CMakeLists.txt
===================================================================
--- lldb/source/DataFormatters/CMakeLists.txt
+++ lldb/source/DataFormatters/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbDataFormatters
+add_lldb_library(lldbDataFormatters NO_PLUGIN_DEPENDENCIES
CXXFunctionPointer.cpp
DataVisualization.cpp
DumpValueObjectOptions.cpp
Index: lldb/source/Core/CMakeLists.txt
===================================================================
--- lldb/source/Core/CMakeLists.txt
+++ lldb/source/Core/CMakeLists.txt
@@ -19,6 +19,7 @@
endif()
endif()
+# TODO: Add property `NO_PLUGIN_DEPENDENCIES` to lldbCore
add_lldb_library(lldbCore
Address.cpp
AddressRange.cpp
Index: lldb/source/Commands/CMakeLists.txt
===================================================================
--- lldb/source/Commands/CMakeLists.txt
+++ lldb/source/Commands/CMakeLists.txt
@@ -2,7 +2,7 @@
SOURCE Options.td
TARGET LLDBOptionsGen)
-add_lldb_library(lldbCommands
+add_lldb_library(lldbCommands NO_PLUGIN_DEPENDENCIES
CommandCompletions.cpp
CommandObjectApropos.cpp
CommandObjectBreakpoint.cpp
Index: lldb/source/Breakpoint/CMakeLists.txt
===================================================================
--- lldb/source/Breakpoint/CMakeLists.txt
+++ lldb/source/Breakpoint/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_library(lldbBreakpoint
+add_lldb_library(lldbBreakpoint NO_PLUGIN_DEPENDENCIES
Breakpoint.cpp
BreakpointID.cpp
BreakpointIDList.cpp
Index: lldb/cmake/modules/AddLLDB.cmake
===================================================================
--- lldb/cmake/modules/AddLLDB.cmake
+++ lldb/cmake/modules/AddLLDB.cmake
@@ -37,7 +37,7 @@
# only supported parameters to this macro are the optional
# MODULE;SHARED;STATIC library type and source files
cmake_parse_arguments(PARAM
- "MODULE;SHARED;STATIC;OBJECT;PLUGIN;FRAMEWORK;NO_INTERNAL_DEPENDENCIES"
+ "MODULE;SHARED;STATIC;OBJECT;PLUGIN;FRAMEWORK;NO_INTERNAL_DEPENDENCIES;NO_PLUGIN_DEPENDENCIES"
"INSTALL_PREFIX;ENTITLEMENTS"
"EXTRA_CXXFLAGS;DEPENDS;LINK_LIBS;LINK_COMPONENTS;CLANG_LIBS"
${ARGN})
@@ -54,6 +54,16 @@
endforeach()
endif()
+ if(PARAM_NO_PLUGIN_DEPENDENCIES)
+ foreach(link_lib ${PARAM_LINK_LIBS})
+ if (link_lib MATCHES "^lldbPlugin")
+ message(FATAL_ERROR
+ "Library ${name} cannot depend on a plugin (Found ${link_lib} in "
+ "LINK_LIBS)")
+ endif()
+ endforeach()
+ endif()
+
if(PARAM_PLUGIN)
set_property(GLOBAL APPEND PROPERTY LLDB_PLUGINS ${name})
endif()
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits