[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.
This commit is contained in:
Siva Chandra 2023-09-08 20:34:00 -07:00 committed by GitHub
parent 0c41681a0c
commit b0068b5b06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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})