-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lldb/cmake] Use ADDITIONAL_HEADER(_DIR)?S #142587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
labath
wants to merge
1
commit into
llvm:main
Choose a base branch
from
labath:cmake2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace (questionable) header globs with an explicit argument supported by llvm_add_library.
@llvm/pr-subscribers-lldb Author: Pavel Labath (labath) ChangesReplace (questionable) header globs with an explicit argument supported by llvm_add_library. Full diff: https://github.com/llvm/llvm-project/pull/142587.diff 17 Files Affected:
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 85ba4fde17418..2aaf75dd87bc3 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -38,6 +38,8 @@ endif()
include(LLDBConfig)
include(AddLLDB)
+set(LLDB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
# Define the LLDB_CONFIGURATION_xxx matching the build type.
if(uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
add_definitions(-DLLDB_CONFIGURATION_DEBUG)
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index 3a9dcb79629b4..de9243b921745 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -71,12 +71,6 @@ function(add_lldb_library name)
set_property(GLOBAL APPEND PROPERTY LLDB_PLUGINS ${name})
endif()
- if (MSVC_IDE OR XCODE)
- string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
- list(GET split_path -1 dir)
- file(GLOB_RECURSE headers
- ../../include/lldb${dir}/*.h)
- endif()
if (PARAM_MODULE)
set(libkind MODULE)
elseif (PARAM_SHARED)
@@ -99,7 +93,7 @@ function(add_lldb_library name)
set(pass_NO_INSTALL_RPATH NO_INSTALL_RPATH)
endif()
- llvm_add_library(${name} ${libkind} ${headers}
+ llvm_add_library(${name} ${libkind}
${PARAM_UNPARSED_ARGUMENTS}
LINK_LIBS ${PARAM_LINK_LIBS}
DEPENDS ${PARAM_DEPENDS}
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 3bc569608e458..bddcf2f9922d0 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -125,6 +125,8 @@ add_lldb_library(liblldb SHARED ${option_framework}
${lldb_python_wrapper}
${lldb_lua_wrapper}
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/API
DEPENDS
lldb-sbapi-dwarf-enums
diff --git a/lldb/source/Breakpoint/CMakeLists.txt b/lldb/source/Breakpoint/CMakeLists.txt
index 6cd3c396a2c50..8ef3705750634 100644
--- a/lldb/source/Breakpoint/CMakeLists.txt
+++ b/lldb/source/Breakpoint/CMakeLists.txt
@@ -26,6 +26,8 @@ add_lldb_library(lldbBreakpoint NO_PLUGIN_DEPENDENCIES
WatchpointOptions.cpp
WatchpointResource.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Breakpoint
LINK_LIBS
lldbCore
lldbExpression
diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt
index c4c442dcb2043..c95c40fb89eef 100644
--- a/lldb/source/Core/CMakeLists.txt
+++ b/lldb/source/Core/CMakeLists.txt
@@ -57,9 +57,11 @@ add_lldb_library(lldbCore NO_PLUGIN_DEPENDENCIES
ThreadedCommunication.cpp
UserSettingsController.cpp
Value.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Core
DEPENDS
clang-tablegen-targets
-
LINK_LIBS
lldbBreakpoint
lldbDataFormatters
diff --git a/lldb/source/DataFormatters/CMakeLists.txt b/lldb/source/DataFormatters/CMakeLists.txt
index 91b10ba9e0ac8..e2bc5b40d72c0 100644
--- a/lldb/source/DataFormatters/CMakeLists.txt
+++ b/lldb/source/DataFormatters/CMakeLists.txt
@@ -18,6 +18,8 @@ add_lldb_library(lldbDataFormatters NO_PLUGIN_DEPENDENCIES
ValueObjectPrinter.cpp
VectorType.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/DataFormatters
LINK_LIBS
lldbCore
lldbInterpreter
diff --git a/lldb/source/Expression/CMakeLists.txt b/lldb/source/Expression/CMakeLists.txt
index 9e1c341947e9d..3a18a83b9a5cd 100644
--- a/lldb/source/Expression/CMakeLists.txt
+++ b/lldb/source/Expression/CMakeLists.txt
@@ -17,9 +17,10 @@ add_lldb_library(lldbExpression NO_PLUGIN_DEPENDENCIES
UserExpression.cpp
UtilityFunction.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Expression
DEPENDS
- intrinsics_gen
-
+ intrinsics_gen
LINK_LIBS
lldbCore
lldbHost
diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
index 90814b1bed4c8..4eb4040250dee 100644
--- a/lldb/source/Host/CMakeLists.txt
+++ b/lldb/source/Host/CMakeLists.txt
@@ -176,6 +176,8 @@ endif()
add_lldb_library(lldbHost NO_PLUGIN_DEPENDENCIES
${HOST_SOURCES}
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Host
LINK_LIBS
lldbUtility
${EXTRA_LIBS}
diff --git a/lldb/source/Host/macosx/objcxx/CMakeLists.txt b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
index cda8269ca9efd..18f894cb8b7e2 100644
--- a/lldb/source/Host/macosx/objcxx/CMakeLists.txt
+++ b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
@@ -8,6 +8,8 @@ add_lldb_library(lldbHostMacOSXObjCXX NO_PLUGIN_DEPENDENCIES
HostThreadMacOSX.mm
MemoryMonitorMacOSX.mm
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Host/macosx/objcxx
LINK_LIBS
lldbUtility
${EXTRA_LIBS}
diff --git a/lldb/source/Initialization/CMakeLists.txt b/lldb/source/Initialization/CMakeLists.txt
index b6282e162aa10..dde1f710ddd2c 100644
--- a/lldb/source/Initialization/CMakeLists.txt
+++ b/lldb/source/Initialization/CMakeLists.txt
@@ -11,6 +11,8 @@ add_lldb_library(lldbInitialization
SystemInitializer.cpp
SystemLifetimeManager.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Initialization
LINK_LIBS
lldbCore
lldbHost
diff --git a/lldb/source/Interpreter/CMakeLists.txt b/lldb/source/Interpreter/CMakeLists.txt
index 642263a8bda7f..1dd071b28946b 100644
--- a/lldb/source/Interpreter/CMakeLists.txt
+++ b/lldb/source/Interpreter/CMakeLists.txt
@@ -55,6 +55,8 @@ add_lldb_library(lldbInterpreter NO_PLUGIN_DEPENDENCIES
Property.cpp
ScriptInterpreter.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Interpreter
LINK_LIBS
lldbInterpreterInterfaces
lldbCommands
diff --git a/lldb/source/Interpreter/Interfaces/CMakeLists.txt b/lldb/source/Interpreter/Interfaces/CMakeLists.txt
index f44672aa50b75..072fcf4057329 100644
--- a/lldb/source/Interpreter/Interfaces/CMakeLists.txt
+++ b/lldb/source/Interpreter/Interfaces/CMakeLists.txt
@@ -1,6 +1,8 @@
add_lldb_library(lldbInterpreterInterfaces NO_PLUGIN_DEPENDENCIES
ScriptedInterfaceUsages.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Interpreter/Interfaces
LINK_LIBS
lldbUtility
diff --git a/lldb/source/Symbol/CMakeLists.txt b/lldb/source/Symbol/CMakeLists.txt
index 86fa8583972b7..30a434ea2d351 100644
--- a/lldb/source/Symbol/CMakeLists.txt
+++ b/lldb/source/Symbol/CMakeLists.txt
@@ -33,6 +33,8 @@ add_lldb_library(lldbSymbol NO_PLUGIN_DEPENDENCIES
Variable.cpp
VariableList.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Symbol
LINK_LIBS
lldbCore
lldbExpression
diff --git a/lldb/source/Target/CMakeLists.txt b/lldb/source/Target/CMakeLists.txt
index d3545913a6902..7765331525340 100644
--- a/lldb/source/Target/CMakeLists.txt
+++ b/lldb/source/Target/CMakeLists.txt
@@ -82,6 +82,8 @@ add_lldb_library(lldbTarget
UnwindLLDB.cpp
VerboseTrapFrameRecognizer.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Target
LINK_LIBS
lldbBreakpoint
lldbCore
diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt
index 6954a2508ffe1..51f3450b1c6e9 100644
--- a/lldb/source/Utility/CMakeLists.txt
+++ b/lldb/source/Utility/CMakeLists.txt
@@ -81,6 +81,8 @@ add_lldb_library(lldbUtility NO_INTERNAL_DEPENDENCIES
XcodeSDK.cpp
ZipFile.cpp
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/Utility
LINK_LIBS
${LLDB_SYSTEM_LIBS}
# lldbUtility does not depend on other LLDB libraries
diff --git a/lldb/source/ValueObject/CMakeLists.txt b/lldb/source/ValueObject/CMakeLists.txt
index 92683916f5a52..5cdc777c9d495 100644
--- a/lldb/source/ValueObject/CMakeLists.txt
+++ b/lldb/source/ValueObject/CMakeLists.txt
@@ -19,7 +19,8 @@ add_lldb_library(lldbValueObject
ValueObjectVariable.cpp
ValueObjectVTable.cpp
-
+ ADDITIONAL_HEADER_DIRS
+ ${LLDB_INCLUDE_DIR}/lldb/ValueObject
LINK_LIBS
lldbBreakpoint
lldbDataFormatters
diff --git a/lldb/source/Version/CMakeLists.txt b/lldb/source/Version/CMakeLists.txt
index 90fe53d52cc5d..8b0acb9ef7550 100644
--- a/lldb/source/Version/CMakeLists.txt
+++ b/lldb/source/Version/CMakeLists.txt
@@ -21,9 +21,6 @@ add_custom_command(OUTPUT "${vcs_version_inc}"
"-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}"
-P "${generate_vcs_version_script}")
-set_source_files_properties("${vcs_version_inc}"
- PROPERTIES GENERATED TRUE
- HEADER_FILE_ONLY TRUE)
# Configure the Version.inc file.
set(version_inc "${LLDB_BINARY_DIR}/include/lldb/Version/Version.inc")
@@ -32,13 +29,15 @@ configure_file(
${LLDB_SOURCE_DIR}/include/lldb/Version/Version.inc.in
${version_inc})
-set_source_files_properties("${version_inc}"
+set_source_files_properties(
+ "${vcs_version_inc}" "${version_inc}"
PROPERTIES GENERATED TRUE
- HEADER_FILE_ONLY TRUE)
-
+)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_lldb_library(lldbVersion NO_PLUGIN_DEPENDENCIES
Version.cpp
- ${vcs_version_inc}
- ${version_inc})
+ ADDITIONAL_HEADERS
+ ${version_inc}
+ ${vcs_version_inc}
+)
|
JDevlieghere
approved these changes
Jun 3, 2025
bulbazord
approved these changes
Jun 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace (questionable) header globs with an explicit argument supported by llvm_add_library.