Skip to content

Commit 4703146

Browse files
author
Diptorup Deb
committed
Add a hack to fix a doxyrest issue.
1 parent de5d53e commit 4703146

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ function(_setup_doxyrest)
4747
set(DOXYREST_OUTPUT_DIR_NAME dpctl-capi-doxyrest)
4848
set(DOXYREST_OUTPUT_DIR
4949
${CMAKE_CURRENT_SOURCE_DIR}/${DOXYREST_OUTPUT_DIR_NAME}
50+
PARENT_SCOPE
51+
)
52+
set(DOXYREST_OUTPUT_DIR
53+
${CMAKE_CURRENT_SOURCE_DIR}/${DOXYREST_OUTPUT_DIR_NAME}
54+
5055
)
5156
set(DOXYREST_CONFIG_IN ${CMAKE_CURRENT_SOURCE_DIR}/doxyrest-config.lua.in)
5257
set(DOXYREST_CONFIG_OUT ${CMAKE_CURRENT_SOURCE_DIR}/doxyrest-config.lua)
@@ -81,7 +86,6 @@ function(_setup_sphinx)
8186
set(SPHINX_INDEX_FILE ${SPHINX_OUTPUT_DIR}/index.html)
8287
set(SPHINX_CONF_IN ${SPHINX_SOURCE}/conf.in)
8388
set(SPHINX_CONF_OUT ${SPHINX_SOURCE}/conf.py)
84-
8589
# Only regenerate Sphinx when:
8690
# - Doxygen has rerun
8791
# - Our doc files have been updated

docs/conf.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ if use_doxyrest == "ON":
4747
os.path.abspath("@DOXYREST_SPHINX_DIR@"),
4848
)
4949
extensions += ["doxyrest", "cpplexer"]
50+
# A workaround to fix issues leftover in the doxyrest generated
51+
# rst files.
52+
import fileinput
53+
54+
with fileinput.FileInput("@DOXYREST_OUTPUT_DIR@/global.rst", inplace=True) as file:
55+
for line in file:
56+
print(line.replace("typedefDPCTL_C_EXTERN_C_BEGIN", ""), end="")
5057

5158
# Add any paths that contain templates here, relative to this directory.
5259
templates_path = ["_templates"]

0 commit comments

Comments
 (0)