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

Ross Brunton via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 03:35:20 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
----------------
RossBrunton wrote:

I still think it's worth copying this to the build directory, but I'm happy to have that be a follow up task.

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


More information about the llvm-commits mailing list