[libc-commits] [libc] [libc] warn when depending on public entrypoints (PR #146163)

via libc-commits libc-commits at lists.llvm.org
Fri Jun 27 18:03:04 PDT 2025


================
@@ -1,4 +1,32 @@
 set(OBJECT_LIBRARY_TARGET_TYPE "OBJECT_LIBRARY")
+set(ENTRYPOINT_OBJ_TARGET_TYPE "ENTRYPOINT_OBJ")
+set(ENTRYPOINT_EXT_TARGET_TYPE "ENTRYPOINT_EXT")
+
+# Rule to check if a list of dependencies contains any entrypoint objects. Returns a list in entrypoint_deps.
+function(check_entrypoint_deps fq_deps_list)
----------------
lntue wrote:

You shouldn't have implicit out-parameter `entrypoint_deps`, make it a required first argument of this call.
`fq_dep_list` can be implicitly collected in `ARGN` is another option:
```
function(check_entrypoint_deps entrypoint_deps)
```
then all the strings provided in the calls `check_entrypoint_deps(entrypoint_deps ...)` will be collected in `ARGN` list.  So inside the loop, you just need
```
foreach(dep IN LISTS ARGN)
```
and this function can be called as:
```
check_entrypoint_deps(entrypoint_deps ${fq_dep_list})
```

https://github.com/llvm/llvm-project/pull/146163


More information about the libc-commits mailing list