https://github.com/labath updated https://github.com/llvm/llvm-project/pull/142587
>From e040dfb3270ca1101ec0c86d74dce26b2d10914a Mon Sep 17 00:00:00 2001 From: Pavel Labath <pa...@labath.sk> Date: Tue, 3 Jun 2025 13:45:04 +0200 Subject: [PATCH] [lldb/cmake] Use ADDITIONAL_HEADER(_DIR)?S Replace (questionable) header globs with an explicit argument supported by llvm_add_library. --- lldb/CMakeLists.txt | 2 ++ lldb/cmake/modules/AddLLDB.cmake | 8 +------- lldb/source/API/CMakeLists.txt | 2 ++ lldb/source/Breakpoint/CMakeLists.txt | 2 ++ lldb/source/Core/CMakeLists.txt | 5 +++-- lldb/source/DataFormatters/CMakeLists.txt | 2 ++ lldb/source/Expression/CMakeLists.txt | 2 ++ lldb/source/Host/CMakeLists.txt | 2 ++ lldb/source/Host/macosx/objcxx/CMakeLists.txt | 2 ++ lldb/source/Initialization/CMakeLists.txt | 2 ++ lldb/source/Interpreter/CMakeLists.txt | 2 ++ lldb/source/Interpreter/Interfaces/CMakeLists.txt | 2 ++ lldb/source/Symbol/CMakeLists.txt | 2 ++ lldb/source/Target/CMakeLists.txt | 2 ++ lldb/source/Utility/CMakeLists.txt | 2 ++ lldb/source/ValueObject/CMakeLists.txt | 2 ++ lldb/source/Version/CMakeLists.txt | 15 +++++++-------- 17 files changed, 39 insertions(+), 17 deletions(-) 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 8b986bf037aac..0108fb22e5a03 100644 --- a/lldb/cmake/modules/AddLLDB.cmake +++ b/lldb/cmake/modules/AddLLDB.cmake @@ -68,12 +68,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) @@ -92,7 +86,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} ${pass_NO_INSTALL_RPATH} diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index cb5f1f831dac0..f5b25237d1edb 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 d8f8f8cbd055e..de23c8737b324 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_COMPONENTS Support LINK_LIBS diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt index 53dc031e90d11..d6b75bca7f2d6 100644 --- a/lldb/source/Core/CMakeLists.txt +++ b/lldb/source/Core/CMakeLists.txt @@ -57,10 +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_COMPONENTS Support Demangle diff --git a/lldb/source/DataFormatters/CMakeLists.txt b/lldb/source/DataFormatters/CMakeLists.txt index 097cbdb4526bc..5f84e4ef43d6b 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_COMPONENTS Support LINK_LIBS diff --git a/lldb/source/Expression/CMakeLists.txt b/lldb/source/Expression/CMakeLists.txt index ac129ce49b5d3..08dc536781f9c 100644 --- a/lldb/source/Expression/CMakeLists.txt +++ b/lldb/source/Expression/CMakeLists.txt @@ -17,6 +17,8 @@ add_lldb_library(lldbExpression NO_PLUGIN_DEPENDENCIES UserExpression.cpp UtilityFunction.cpp + ADDITIONAL_HEADER_DIRS + ${LLDB_INCLUDE_DIR}/lldb/Expression DEPENDS intrinsics_gen diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt index 21f4a89c0e211..5b713133afeaf 100644 --- a/lldb/source/Host/CMakeLists.txt +++ b/lldb/source/Host/CMakeLists.txt @@ -177,6 +177,8 @@ endif() add_lldb_library(lldbHost NO_PLUGIN_DEPENDENCIES ${HOST_SOURCES} + ADDITIONAL_HEADER_DIRS + ${LLDB_INCLUDE_DIR}/lldb/Host LINK_COMPONENTS Object Support diff --git a/lldb/source/Host/macosx/objcxx/CMakeLists.txt b/lldb/source/Host/macosx/objcxx/CMakeLists.txt index a55fc222bf5ad..1d7573335b8ec 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_COMPONENTS Support TargetParser diff --git a/lldb/source/Initialization/CMakeLists.txt b/lldb/source/Initialization/CMakeLists.txt index 9b81facb2eebc..26343f93ecfea 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_COMPONENTS Support LINK_LIBS diff --git a/lldb/source/Interpreter/CMakeLists.txt b/lldb/source/Interpreter/CMakeLists.txt index 99e8ec7dfd57d..8af7373702c38 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_COMPONENTS Support LINK_LIBS diff --git a/lldb/source/Interpreter/Interfaces/CMakeLists.txt b/lldb/source/Interpreter/Interfaces/CMakeLists.txt index 8b0439883750f..14fcc71fd9a71 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_COMPONENTS Support LINK_LIBS diff --git a/lldb/source/Symbol/CMakeLists.txt b/lldb/source/Symbol/CMakeLists.txt index f484304ed1699..28d12b3012798 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_COMPONENTS Support LINK_LIBS diff --git a/lldb/source/Target/CMakeLists.txt b/lldb/source/Target/CMakeLists.txt index 5d40f320fd8fd..b7788e80eecac 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_COMPONENTS Support MC diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt index 5732d977d4be4..1dd4d63f7016f 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_COMPONENTS BinaryFormat Support diff --git a/lldb/source/ValueObject/CMakeLists.txt b/lldb/source/ValueObject/CMakeLists.txt index a6f9ffb0908f2..db590f757972a 100644 --- a/lldb/source/ValueObject/CMakeLists.txt +++ b/lldb/source/ValueObject/CMakeLists.txt @@ -19,6 +19,8 @@ add_lldb_library(lldbValueObject ValueObjectVariable.cpp ValueObjectVTable.cpp + ADDITIONAL_HEADER_DIRS + ${LLDB_INCLUDE_DIR}/lldb/ValueObject LINK_COMPONENTS Support Demangle 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} +) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits