[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:06:49 PDT 2025
================
@@ -230,6 +268,18 @@ function(create_entrypoint_object fq_target_name)
_get_common_compile_options(common_compile_options "${ADD_ENTRYPOINT_OBJ_FLAGS}")
list(APPEND common_compile_options ${ADD_ENTRYPOINT_OBJ_COMPILE_OPTIONS})
get_fq_deps_list(fq_deps_list ${ADD_ENTRYPOINT_OBJ_DEPENDS})
+
+ #loop through the deps, check if any have the TARGET_TYPE of entrypoint_target_type, and print a warning if they do.
+ if(LIBC_CMAKE_VERBOSE_LOGGING)
+ set(entrypoint_deps "")
+ if(NOT "${fq_deps_list}" STREQUAL "")
+ check_entrypoint_deps("${fq_deps_list}")
+ endif()
+ if(NOT "${entrypoint_deps}" STREQUAL "")
+ message(WARNING "Entrypoint ${fq_target_name} depends on public entrypoint(s) ${entrypoint_deps}.\nDepending on public entrypoints is not allowed in internal code.")
----------------
lntue wrote:
nit: break the string into multiple lines
https://github.com/llvm/llvm-project/pull/146163
More information about the libc-commits
mailing list