Skip to content

Commit b0068b5

Browse files
authored
[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.
1 parent 0c41681 commit b0068b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libc/cmake/modules/LLVMLibCLibraryRules.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function(create_header_library fq_target_name)
152152
"ADD_HEADER"
153153
"" # Optional arguments
154154
"" # Single value arguments
155-
"HDRS;DEPENDS;FLAGS" # Multi-value arguments
155+
"HDRS;DEPENDS;FLAGS;COMPILE_OPTIONS" # Multi-value arguments
156156
${ARGN}
157157
)
158158

@@ -187,6 +187,9 @@ function(create_header_library fq_target_name)
187187
PROPERTIES
188188
INTERFACE_FLAGS "${ADD_HEADER_FLAGS}"
189189
)
190+
if(ADD_HEADER_COMPILE_OPTIONS)
191+
target_compile_options(${interface_target_name} INTERFACE ${ADD_HEADER_COMPILE_OPTIONS})
192+
endif()
190193

191194
add_custom_target(${fq_target_name})
192195
add_dependencies(${fq_target_name} ${interface_target_name})

0 commit comments

Comments
 (0)