[libc-commits] [libc] [libc][docgen] regen docgen via cmake (PR #119628)
Nick Desaulniers via libc-commits
libc-commits at lists.llvm.org
Thu Dec 12 09:20:28 PST 2024
================
@@ -4,6 +4,33 @@ include(AddSphinxTarget)
if (SPHINX_FOUND)
if (${SPHINX_OUTPUT_HTML})
add_sphinx_target(html libc)
+
+ list(APPEND docgen_list
+ assert
+ ctype
+ errno
+ fenv
+ float
+ inttypes
+ locale
+ setjmp
+ signal
+ stdbit
+ stdlib
+ string
+ strings
+ threads
+ uchar
+ wchar
+ wctype
+ )
+
+ foreach(stem IN LISTS docgen_list)
+ add_custom_target(${stem}_rst
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../utils/docgen/docgen.py ${stem}.h >
+ ${CMAKE_CURRENT_SOURCE_DIR}/headers/${stem}.rst)
----------------
nickdesaulniers wrote:
So there's probably a better way to do this. IIUC, it's going to run the command every time, which isn't necessary. We should only need to re-run the command in the input file (`libc/utils/docgen/{stem}.json`) is modified. Not sure yet how to express that in cmake...
https://github.com/llvm/llvm-project/pull/119628
More information about the libc-commits
mailing list