[llvm] [Offload] Add Offload API Sphinx documentation (PR #147323)

Kenneth Benzie via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 02:52:39 PDT 2025


================
@@ -0,0 +1,37 @@
+if(LLVM_ENABLE_SPHINX)
+  include(AddSphinxTarget)
+  if(SPHINX_FOUND AND SPHINX_OUTPUT_HTML)
+    # Generate offload-api.rst from OffloadAPI.td
+    set(LLVM_TARGET_DEFINITIONS
+      ${OFFLOAD_SOURCE_DIR}/liboffload/API/OffloadAPI.td)
+    tablegen(OFFLOAD source/offload-api.rst -gen-doc
+      EXTRA_INCLUDES ${OFFLOAD_SOURCE_DIR}/liboffload/API)
+    add_public_tablegen_target(OffloadDocsGenerate)
+
+    # Due to Sphinx only allowing a single source direcotry and the fact we
+    # only generate a single file, copy offload-api.rst to the source directory
+    # to be included in the generated documentation.
+    # Additionally, copy the llvm-theme into the Sphinx source directory.
+    # A .gitignore file ensures the copied files will not be added to the
----------------
kbenzie wrote:

I don't believe so. The list of static resources is known and fixed. The future addition of other documetnation files is not known and I think we should avoid requiring contributors to include their new files in CMake.

https://github.com/llvm/llvm-project/pull/147323


More information about the llvm-commits mailing list