[libc-commits] [libc] [libc] fix dependencies for fprintf (PR #98752)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Sat Jul 13 10:33:25 PDT 2024


https://github.com/SchrodingerZhu created https://github.com/llvm/llvm-project/pull/98752

None

>From 92fe1030b25d98932ba5efbefc00257c2322d8fd Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Sat, 13 Jul 2024 10:32:41 -0700
Subject: [PATCH] [libc] fix dependencies for fprintf

---
 libc/src/stdio/generic/CMakeLists.txt | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/libc/src/stdio/generic/CMakeLists.txt b/libc/src/stdio/generic/CMakeLists.txt
index fdb0716f924d..bf301a6b0cb3 100644
--- a/libc/src/stdio/generic/CMakeLists.txt
+++ b/libc/src/stdio/generic/CMakeLists.txt
@@ -363,16 +363,24 @@ add_entrypoint_object(
     libc.src.__support.File.platform_file
 )
 
-list(APPEND printf_deps
+list(APPEND fprintf_deps
       libc.hdr.types.FILE
       libc.src.__support.arg_list
       libc.src.stdio.printf_core.vfprintf_internal
 )
 
 if(LLVM_LIBC_FULL_BUILD)
-  list(APPEND printf_deps
+  list(APPEND fprintf_deps
       libc.src.__support.File.file
       libc.src.__support.File.platform_file
+  )
+endif()
+
+# Copy the deps for printf_deps
+set(printf_deps ${fprintf_deps})
+
+if(LLVM_LIBC_FULL_BUILD)
+  list(APPEND printf_deps
       libc.src.__support.File.platform_stdout
   )
 endif()
@@ -404,7 +412,7 @@ add_entrypoint_object(
   HDRS
     ../fprintf.h
   DEPENDS
-    ${printf_deps}
+    ${fprintf_deps}
 )
 
 add_entrypoint_object(
@@ -414,7 +422,7 @@ add_entrypoint_object(
   HDRS
     ../vfprintf.h
   DEPENDS
-    ${printf_deps}
+    ${fprintf_deps}
 )
 
 add_entrypoint_object(



More information about the libc-commits mailing list