Skip to content

Commit bb95dce

Browse files
SebastianBoenashif
authored andcommitted
west: Fix defining modules without a module.yml
It is supported to have a zephyr module that does not have a module.yml, but zephyr_module.py does not support it and will drop such modules. To fix this we add support in zephyr_module.py. Signed-off-by: Sebastian Bøe <[email protected]>
1 parent efffdfc commit bb95dce

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/zephyr_module.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def process_module(module):
7979
module_path = PurePath(module)
8080
module_yml = module_path.joinpath('zephyr/module.yml')
8181

82+
# The input is a module if zephyr/module.yml is a valid yaml file
83+
# or if both zephyr/CMakeLists.txt and zephyr/Kconfig are present.
84+
8285
if Path(module_yml).is_file():
8386
with Path(module_yml).open('r') as f:
8487
meta = yaml.safe_load(f.read())
@@ -92,6 +95,10 @@ def process_module(module):
9295

9396
return meta
9497

98+
if Path(module_path.joinpath('zephyr/CMakeLists.txt')).is_file() and \
99+
Path(module_path.joinpath('zephyr/Kconfig')).is_file():
100+
return {'build': {'cmake': 'zephyr', 'kconfig': 'zephyr/Kconfig'}}
101+
95102
return None
96103

97104

0 commit comments

Comments
 (0)