[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:17:21 PST 2024


https://github.com/nickdesaulniers updated https://github.com/llvm/llvm-project/pull/119628

>From f597df445af7e96c23e1a8538bfcf4860c49cd07 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 11 Dec 2024 15:02:54 -0800
Subject: [PATCH 1/2] [libc][docgen] regen docgen via cmake

---
 libc/docs/CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libc/docs/CMakeLists.txt b/libc/docs/CMakeLists.txt
index be09423d38e8e3..c8e9bcd29f612c 100644
--- a/libc/docs/CMakeLists.txt
+++ b/libc/docs/CMakeLists.txt
@@ -4,6 +4,15 @@ include(AddSphinxTarget)
 if (SPHINX_FOUND)
   if (${SPHINX_OUTPUT_HTML})
     add_sphinx_target(html libc)
+
+    list(APPEND docgen_list string strings)
+
+    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)
+      add_dependencies(docs-libc-html ${stem}_rst)
+    endforeach()
   endif()
 endif()
 endif()

>From 2f7a9eefa0283144ec0c7c78d203f1c139d08210 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Thu, 12 Dec 2024 09:17:04 -0800
Subject: [PATCH 2/2] expand docgen_list

---
 libc/docs/CMakeLists.txt | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/libc/docs/CMakeLists.txt b/libc/docs/CMakeLists.txt
index c8e9bcd29f612c..5bc2d3a67d566b 100644
--- a/libc/docs/CMakeLists.txt
+++ b/libc/docs/CMakeLists.txt
@@ -5,7 +5,25 @@ if (SPHINX_FOUND)
   if (${SPHINX_OUTPUT_HTML})
     add_sphinx_target(html libc)
 
-    list(APPEND docgen_list string strings)
+    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



More information about the libc-commits mailing list