[libc-commits] [libc] b0068b5 - [libc][NFC] Make add_header_library rule support COMPILE_OPTIONS. (#65821)

via libc-commits libc-commits at lists.llvm.org
Fri Sep 8 20:34:04 PDT 2023


Author: Siva Chandra
Date: 2023-09-08T20:34:00-07:00
New Revision: b0068b5b06b9228d799c353aaedbdb6b6c660cfd

URL: https://github.com/llvm/llvm-project/commit/b0068b5b06b9228d799c353aaedbdb6b6c660cfd
DIFF: https://github.com/llvm/llvm-project/commit/b0068b5b06b9228d799c353aaedbdb6b6c660cfd.diff

LOG: [libc][NFC] Make add_header_library rule support COMPILE_OPTIONS. (#65821)

The options added via COMPILE_OPTIONS will be treated as INTERFACE
options. This will help in setting compile options based on libc config
options in future patches.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCLibraryRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index c2e5594a09fc321..8ffe2d3b739926c 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -152,7 +152,7 @@ function(create_header_library fq_target_name)
     "ADD_HEADER"
     "" # Optional arguments
     "" # Single value arguments
-    "HDRS;DEPENDS;FLAGS" # Multi-value arguments
+    "HDRS;DEPENDS;FLAGS;COMPILE_OPTIONS" # Multi-value arguments
     ${ARGN}
   )
 
@@ -187,6 +187,9 @@ function(create_header_library fq_target_name)
     PROPERTIES
       INTERFACE_FLAGS "${ADD_HEADER_FLAGS}"
   )
+  if(ADD_HEADER_COMPILE_OPTIONS)
+    target_compile_options(${interface_target_name} INTERFACE ${ADD_HEADER_COMPILE_OPTIONS})
+  endif()
 
   add_custom_target(${fq_target_name})
   add_dependencies(${fq_target_name} ${interface_target_name})


        


More information about the libc-commits mailing list