Alias used to produce the link to the DTS API docs uses config data.
The required value in config data was being added in the wrong scope.
This moves the key addition to where the config data object is created.

DTS docs need to be placed in the same dir as main API docs.
Made DTS docs dependent on main docs and stopped separate install step
relying instead on the parent docs to install them.
This means they can no longer be build without main docs.

Added a line to sphinx python wrapper to create the destination path
if not already present.

Fixes: 7f9326423a04 ("dts: add API doc generation")

Signed-off-by: Paul Szczepanek <paul.szczepa...@arm.com>
Acked-by: Patrick Robb <pr...@iol.unh.edu>
---
 buildtools/call-sphinx-build.py |  3 +++
 doc/api/dts/meson.build         | 12 +++++-------
 doc/api/meson.build             |  7 ++++---
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py
index 5810b7c84e..2c7de54285 100755
--- a/buildtools/call-sphinx-build.py
+++ b/buildtools/call-sphinx-build.py
@@ -25,6 +25,9 @@
 for root, dirs, files in os.walk(src):
     srcfiles.extend([join(root, f) for f in files])
 
+# create destination path if not already present
+os.makedirs(dst, exist_ok=True)
+
 # run sphinx, putting the html output in a "html" directory
 with open(join(dst, 'sphinx_html.out'), 'w') as out:
     process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')],
diff --git a/doc/api/dts/meson.build b/doc/api/dts/meson.build
index 5115df7095..fc147f13f3 100644
--- a/doc/api/dts/meson.build
+++ b/doc/api/dts/meson.build
@@ -11,21 +11,19 @@ if python_ver_satisfied != 0
     subdir_done()
 endif
 
-cdata.set('DTS_API_MAIN_PAGE', join_paths('..', 'dts', 'html', 'index.html'))
-
 extra_sphinx_args = ['-E', '-c', join_paths(doc_source_dir, 'guides')]
 if get_option('werror')
     extra_sphinx_args += '-W'
 endif
 
-htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk', 'dts')
+# DTS docs are generated inside main Doxygen docs build directory
+# DTS docs relies on main docs to install it so does not define install dir
 dts_api_html = custom_target('dts_api_html',
+        depends: doxy_html_build,
         output: 'html',
         command: [sphinx_wrapper, sphinx, meson.project_version(),
-            meson.current_source_dir(), meson.current_build_dir(), 
extra_sphinx_args],
-        build_by_default: get_option('enable_docs'),
-        install: get_option('enable_docs'),
-        install_dir: htmldir)
+            meson.current_source_dir(), join_paths(api_build_dir, 'html', 
'dts'), extra_sphinx_args],
+        build_by_default: get_option('enable_docs'))
 
 doc_targets += dts_api_html
 doc_target_names += 'DTS_API_HTML'
diff --git a/doc/api/meson.build b/doc/api/meson.build
index ae23e9825e..f9f1326bbd 100644
--- a/doc/api/meson.build
+++ b/doc/api/meson.build
@@ -4,9 +4,6 @@
 doxygen = find_program('doxygen', required: get_option('enable_docs'))
 
 if not doxygen.found()
-  # process DTS API doc build even if DPDK API doc build can't be done
-  cdata = configuration_data()
-  subdir('dts')
   subdir_done()
 endif
 
@@ -40,6 +37,7 @@ cdata.set('OUTPUT', join_paths(dpdk_build_root, 'doc', 'api'))
 cdata.set('TOPDIR', dpdk_source_root)
 cdata.set('STRIP_FROM_PATH', ' '.join([dpdk_source_root, 
join_paths(dpdk_build_root, 'doc', 'api')]))
 cdata.set('WARN_AS_ERROR', 'NO')
+cdata.set('DTS_API_MAIN_PAGE', join_paths('.', 'dts', 'html', 'index.html'))
 if get_option('werror')
     cdata.set('WARN_AS_ERROR', 'YES')
 endif
@@ -104,4 +102,7 @@ if mandb.found() and get_option('enable_docs')
     meson.add_install_script(mandb)
 endif
 
+# used by DTS to place its files into
+api_build_dir = meson.current_build_dir()
+
 subdir('dts')
-- 
2.39.2

Reply via email to