diff --git a/cmake/zephyr_module.cmake b/cmake/zephyr_module.cmake index 4ce037d2fe1..a0f16c619b9 100644 --- a/cmake/zephyr_module.cmake +++ b/cmake/zephyr_module.cmake @@ -20,12 +20,17 @@ endif() set(KCONFIG_MODULES_FILE ${CMAKE_BINARY_DIR}/Kconfig.modules) +if(WEST) + set(WEST_ARG "--west-path" ${WEST}) +endif() + if(WEST OR ZEPHYR_MODULES) # Zephyr module uses west, so only call it if west is installed or # ZEPHYR_MODULES was provided as argument to CMake. execute_process( COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/zephyr_module.py + ${WEST_ARG} ${ZEPHYR_MODULES_ARG} ${ZEPHYR_EXTRA_MODULES_ARG} --kconfig-out ${KCONFIG_MODULES_FILE} diff --git a/scripts/zephyr_module.py b/scripts/zephyr_module.py index 485eac3df6d..f384e81e7d4 100755 --- a/scripts/zephyr_module.py +++ b/scripts/zephyr_module.py @@ -119,10 +119,12 @@ def main(): 'list`') parser.add_argument('-x', '--extra-modules', nargs='+', help='List of extra modules to parse') + parser.add_argument('-w', '--west-path', default='west', + help='Path to west executable') args = parser.parse_args() if args.modules is None: - p = subprocess.Popen(['west', 'list', '--format={posixpath}'], + p = subprocess.Popen([args.west_path, 'list', '--format={posixpath}'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate()