[clang] [Clang][CMake] fix header target creation (PR #180609)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 9 12:54:13 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-x86
Author: Victor Mustya (vmustya)
<details>
<summary>Changes</summary>
The `add_header_target` function was using a `file_list` parameter that
was supposed to capture all the header files that should be added to the
interface library target. However, the parameter was only capturing the
first header file, and the rest of the header files were not being added
to the target properties. I.e. the `get_target_properties` command was
only returning the first header file instead of all the header files.
The commit removes the `file_list` parameter and replaces it with `ARGN`,
which captures all the header files passed to the function. This ensures
that all the header files are added to the interface library target and
can be accessed through the target properties.
---
Full diff: https://github.com/llvm/llvm-project/pull/180609.diff
1 Files Affected:
- (modified) clang/lib/Headers/CMakeLists.txt (+2-2)
``````````diff
diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index c92b370b88d2d..95d20bbca79ac 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -516,8 +516,8 @@ foreach( f ${generated_files} )
endif()
endforeach( f )
-function(add_header_target target_name file_list)
- add_library(${target_name} INTERFACE ${file_list})
+function(add_header_target target_name)
+ add_library(${target_name} INTERFACE ${ARGN})
set_target_properties(${target_name} PROPERTIES
FOLDER "Clang/Resources"
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
``````````
</details>
https://github.com/llvm/llvm-project/pull/180609
More information about the cfe-commits
mailing list