|
44 | 44 | from typing import Any
|
45 | 45 |
|
46 | 46 | from docutils import nodes
|
| 47 | +from dotenv import load_dotenv |
47 | 48 | from sphinx.addnodes import pending_xref
|
48 | 49 | from sphinx.application import Sphinx
|
49 | 50 | from sphinx.builders import Builder
|
@@ -76,12 +77,17 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d
|
76 | 77 | modules = zephyr_module.parse_modules(ZEPHYR_BASE)
|
77 | 78 |
|
78 | 79 | # generate Kconfig.modules file
|
| 80 | + kconfig_module_dirs = "" |
79 | 81 | kconfig = ""
|
80 | 82 | sysbuild_kconfig = ""
|
81 | 83 | for module in modules:
|
| 84 | + kconfig_module_dirs += zephyr_module.process_kconfig_module_dir(module.project, module.meta) |
82 | 85 | kconfig += zephyr_module.process_kconfig(module.project, module.meta)
|
83 | 86 | sysbuild_kconfig += zephyr_module.process_sysbuildkconfig(module.project, module.meta)
|
84 | 87 |
|
| 88 | + with open(Path(td) / "kconfig_module_dirs.env", "w") as f: |
| 89 | + f.write(kconfig_module_dirs) |
| 90 | + |
85 | 91 | with open(Path(td) / "Kconfig.modules", "w") as f:
|
86 | 92 | f.write(kconfig)
|
87 | 93 |
|
@@ -150,6 +156,9 @@ def kconfig_load(app: Sphinx) -> tuple[kconfiglib.Kconfig, kconfiglib.Kconfig, d
|
150 | 156 | os.environ["BOARD"] = "boards"
|
151 | 157 | os.environ["KCONFIG_BOARD_DIR"] = str(Path(td) / "boards")
|
152 | 158 |
|
| 159 | + # Include environmental values for module paths |
| 160 | + load_dotenv(Path(td) / "kconfig_module_dirs.env") |
| 161 | + |
153 | 162 | # Sysbuild runs first
|
154 | 163 | os.environ["CONFIG_"] = "SB_CONFIG_"
|
155 | 164 | sysbuild_output = kconfiglib.Kconfig(ZEPHYR_BASE / "share" / "sysbuild" / "Kconfig")
|
|
0 commit comments