From 69809a0384cd63dcf107d177d59a95e526cc2cd5 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 31 Oct 2023 06:13:16 +0100 Subject: [PATCH] docs: allow out-of-tree docs build Hawkmoth runs from the build-directory, which makes sense. However, we set up a bunch of source-relative include paths, which will break if we don't build in-tree. Let's make these relative to the source-tree instead. We can deduce the source-root from the parent directory of the current file. Reviewed-by: Daniel Stone Reviewed-by: Eric Engestrom Part-of: --- docs/conf.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index a5df3b8f1bf..a386b3550f5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -219,13 +219,14 @@ graphviz_output_format = 'svg' # -- Options for hawkmoth ------------------------------------------------- hawkmoth_root = os.path.abspath(os.pardir) +mesa_root = os.path.join(os.path.dirname(__file__), os.pardir) hawkmoth_clang = [ - '-Idocs/header-stubs/', - '-Iinclude/', - '-Isrc/', - '-Isrc/gallium/include/', - '-Isrc/intel/', - '-Isrc/mesa/', + '-I{}/docs/header-stubs/'.format(mesa_root), + '-I{}/include/'.format(mesa_root), + '-I{}/src/'.format(mesa_root), + '-I{}/src/gallium/include/'.format(mesa_root), + '-I{}/src/intel/'.format(mesa_root), + '-I{}/src/mesa/'.format(mesa_root), '-DHAVE_STRUCT_TIMESPEC', '-DHAVE_PTHREAD', '-DHAVE_ENDIAN_H',