[libc-commits] [libc] [libc] newheadergen: cmake configuration (PR #98554)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Thu Jul 11 15:13:48 PDT 2024
================
@@ -66,7 +66,91 @@ function(add_header target_name)
)
endfunction(add_header)
-# A rule for generated header file targets.
+function(add_gen_header2 target_name)
+ cmake_parse_arguments(
+ "ADD_YAML_HDR"
+ "PUBLIC" # No optional arguments
+ "YAML_FILE;DEF_FILE;GEN_HDR" # Single value arguments
+ "DEPENDS" # Multi value arguments
+ ${ARGN}
+ )
+ get_fq_target_name(${target_name} fq_target_name)
+ if(NOT LLVM_LIBC_FULL_BUILD)
+ # We don't want to use generated headers if we are doing a non-full-build.
+ add_library(${fq_target_name} INTERFACE)
+ return()
+ endif()
+ if(NOT ADD_YAML_HDR_DEF_FILE)
+ message(FATAL_ERROR "`add_yaml_hdr` rule requires DEF_FILE to be specified.")
----------------
michaelrj-google wrote:
these also need to be updated
https://github.com/llvm/llvm-project/pull/98554
More information about the libc-commits
mailing list