|
9 | 9 | import sys |
10 | 10 | import yaml |
11 | 11 |
|
| 12 | +from pathlib import Path |
| 13 | +from zephyr_ext_common import ZEPHYR_BASE |
| 14 | +sys.path.append(os.fspath(Path(__file__).parent.parent)) |
| 15 | +import zephyr_module |
| 16 | + |
12 | 17 | from west import log |
13 | 18 | from west.configuration import config |
14 | 19 | from zcmake import DEFAULT_CMAKE_GENERATOR, run_cmake, run_build, CMakeCache |
@@ -557,7 +562,24 @@ def _run_cmake(self, board, origin, cmake_opts): |
557 | 562 | if user_args: |
558 | 563 | cmake_opts.extend(shlex.split(user_args)) |
559 | 564 |
|
560 | | - config_sysbuild = config_getboolean('sysbuild', False) |
| 565 | + config_sysbuild = config_getboolean('sysbuild', None) |
| 566 | + |
| 567 | + if config_sysbuild is None: |
| 568 | + # Check if this is an ncs-repo directory |
| 569 | + allow_list = [ 'mcuboot', 'sidewalk', 'find-my', 'nrf', 'matter', 'suit-processor', |
| 570 | + 'memfault-firmware-sdk', 'zscilib', 'uoscore-uedhoc', 'zcbor', |
| 571 | + 'hal_nordic' ] |
| 572 | + config_sysbuild = False |
| 573 | + |
| 574 | + for module in zephyr_module.parse_modules(ZEPHYR_BASE, self.manifest): |
| 575 | + if module.meta['name'] in allow_list and Path(self.source_dir).is_relative_to(module.project): |
| 576 | + config_sysbuild = True |
| 577 | + break |
| 578 | + |
| 579 | + if config_sysbuild is False and Path(self.source_dir).is_relative_to(ZEPHYR_BASE): |
| 580 | + config_sysbuild = True |
| 581 | + |
| 582 | + |
561 | 583 | if self.args.sysbuild or (config_sysbuild and not self.args.no_sysbuild): |
562 | 584 | cmake_opts.extend(['-S{}'.format(SYSBUILD_PROJ_DIR), |
563 | 585 | '-DAPP_DIR:PATH={}'.format(self.source_dir)]) |
|
0 commit comments