[libc-commits] [libc] [libc] Generate configure.rst from the JSON config information. (PR #65791)
via libc-commits
libc-commits at lists.llvm.org
Fri Sep 8 12:29:32 PDT 2023
================
@@ -135,3 +135,85 @@ function(load_libc_config config_file)
set(${opt_name} ${opt_value} PARENT_SCOPE)
endforeach()
endfunction()
+
+function(generate_config_doc config_file doc_file)
+ if(NOT EXISTS ${config_file})
+ message(FATAL_ERROR "${config_file} does not exist")
+ endif()
+ file(READ ${config_file} json_config)
+ string(JSON group_count ERROR_VARIABLE json_error LENGTH ${json_config})
+ if(json_error)
+ message(FATAL_ERROR "${config_file}: ${json_error}")
+ endif()
+ if(${group_count} EQUAL 0)
+ message(FATAL_ERROR "${config_file}: Does not contain any config option groups")
+ return()
----------------
lntue wrote:
Doesn't `FATAL_ERROR` from the line above stop cmake processing completely?
https://github.com/llvm/llvm-project/pull/65791
More information about the libc-commits
mailing list