[libc-commits] [libc] 3bfd6a7 - [libc][NFC] Add compile options only to the header libraries which use them. (#67447)
    via libc-commits 
    libc-commits at lists.llvm.org
       
    Tue Sep 26 09:20:05 PDT 2023
    
    
  
Author: Siva Chandra
Date: 2023-09-26T09:20:00-07:00
New Revision: 3bfd6a7521320ddffd5219569067f17e9843b26e
URL: https://github.com/llvm/llvm-project/commit/3bfd6a7521320ddffd5219569067f17e9843b26e
DIFF: https://github.com/llvm/llvm-project/commit/3bfd6a7521320ddffd5219569067f17e9843b26e.diff
LOG: [libc][NFC] Add compile options only to the header libraries which use them. (#67447)
Other libraries dependent on these libraries will automatically inherit
those compile options. This change in particular affects the compile
option "-DLIBC_COPT_STDIO_USE_SYSTEM_FILE".
Added: 
    
Modified: 
    libc/src/stdio/CMakeLists.txt
    libc/src/stdio/printf_core/CMakeLists.txt
    libc/src/stdio/scanf_core/CMakeLists.txt
Removed: 
    
################################################################################
diff  --git a/libc/src/stdio/CMakeLists.txt b/libc/src/stdio/CMakeLists.txt
index 0ec4c608ad8425f..169bc592dee4885 100644
--- a/libc/src/stdio/CMakeLists.txt
+++ b/libc/src/stdio/CMakeLists.txt
@@ -137,7 +137,6 @@ add_entrypoint_object(
     fscanf.h
   DEPENDS
     ${scanf_deps}
-  ${use_system_file}
 )
 
 add_entrypoint_object(
@@ -148,7 +147,6 @@ add_entrypoint_object(
     scanf.h
   DEPENDS
     ${scanf_deps}
-  ${use_system_file}
 )
 
 add_entrypoint_object(
@@ -194,7 +192,6 @@ add_entrypoint_object(
     printf.h
   DEPENDS
     ${printf_deps}
-  ${use_system_file}
 )
 
 add_entrypoint_object(
@@ -206,7 +203,6 @@ add_entrypoint_object(
   DEPENDS
     libc.src.__support.arg_list
     libc.src.stdio.printf_core.vfprintf_internal
-  ${use_system_file}
 )
 
 add_entrypoint_object(
@@ -239,7 +235,6 @@ add_entrypoint_object(
     vprintf.h
   DEPENDS
     ${printf_deps}
-  ${use_system_file}
 )
 
 add_entrypoint_object(
@@ -251,7 +246,6 @@ add_entrypoint_object(
   DEPENDS
     libc.src.__support.arg_list
     libc.src.stdio.printf_core.vfprintf_internal
-  ${use_system_file}
 )
 
 add_subdirectory(printf_core)
diff  --git a/libc/src/stdio/printf_core/CMakeLists.txt b/libc/src/stdio/printf_core/CMakeLists.txt
index 1b6f763e084be9b..8da274395526df6 100644
--- a/libc/src/stdio/printf_core/CMakeLists.txt
+++ b/libc/src/stdio/printf_core/CMakeLists.txt
@@ -125,4 +125,5 @@ add_header_library(
     libc.src.__support.arg_list
     libc.src.stdio.printf_core.printf_main
     libc.src.stdio.printf_core.writer
+  ${use_system_file}
 )
diff  --git a/libc/src/stdio/scanf_core/CMakeLists.txt b/libc/src/stdio/scanf_core/CMakeLists.txt
index 1fab27d3d28b5e0..060dc2d239eee67 100644
--- a/libc/src/stdio/scanf_core/CMakeLists.txt
+++ b/libc/src/stdio/scanf_core/CMakeLists.txt
@@ -90,4 +90,5 @@ add_header_library(
     libc.include.stdio
     libc.src.__support.File.file
     libc.src.__support.arg_list
+  ${use_system_file}
 )
        
    
    
More information about the libc-commits
mailing list