Lines Matching +full:sysbuild +full:- +full:cmake

3 # SPDX-License-Identifier: Apache-2.0
22 _ARG_SEPARATOR = '--'
25 / pathlib.Path('share/sysbuild')
30 west build [-h] [-b BOARD[@REV]]] [-d BUILD_DIR]
31 [-S SNIPPET] [--shield SHIELD]
32 [-t TARGET] [-p {auto, always, never}] [-c] [--cmake-only]
33 [-n] [-o BUILD_OPT] [-f]
34 [--sysbuild | --no-sysbuild] [--domain DOMAIN]
35 [--extra-conf FILE.conf]
36 [--extra-dtc-overlay FILE.overlay]
37 [source_dir] -- [cmake_opt [cmake_opt ...]]
47 cmake_opt extra options to pass to cmake; implies -c
48 (these must come after "--" as shown above)
52 A "pristine" build directory is empty. The -p option controls
54 is done. A bare '--pristine' with no value is the same as
55 --pristine=always. Setting --pristine=auto uses heuristics to
74 # Keep this in sync with the string in west-commands.yml.
89 '''True if CMake was run; False otherwise.
91 Note: this only describes CMake runs done by this command. The
92 build system generated by CMake may also update itself due to
96 '''Final parsed CMake cache for the build, or None on error.'''
99 self.inf('-- west build: ' + msg, colorize=True)
109 # Remember to update west-completion.bash if you add or remove
112 parser.add_argument('-b', '--board',
115 parser.add_argument('-s', '--source-dir', help=argparse.SUPPRESS)
116 parser.add_argument('-d', '--build-dir',
120 group = parser.add_argument_group('cmake and build tool')
121 group.add_argument('-c', '--cmake', action='store_true',
122 help='force a cmake run')
123 group.add_argument('--cmake-only', action='store_true',
124 help="just run cmake; don't build (implies -c)")
125 group.add_argument('--domain', action='append',
128 group.add_argument('-t', '--target',
130 (try "-t usage")''')
131 group.add_argument('-T', '--test-item',
139 group.add_argument('-o', '--build-opt', default=[], action='append',
142 group.add_argument('-n', '--just-print', '--dry-run', '--recon',
145 group.add_argument('-S', '--snippet', dest='snippets', metavar='SNIPPET',
148 multiple times. Forces CMake to run again if given.
150 -DSNIPPET... cmake arguments: the results are
152 group.add_argument('--shield', dest='shields', metavar='SHIELD',
155 multiple times. Forces CMake to run again if given.
157 -DSHIELD... cmake arguments: the results are
159 group.add_argument('--extra-conf', dest='extra_conf_files', metavar='EXTRA_CONF_FILE',
162 multiple times. Forces CMake to run again if given.
164 -DEXTRA_CONF_FILE... cmake arguments: the results are
166 group.add_argument('--extra-dtc-overlay', dest='extra_dtc_overlay_files',
169 multiple times. Forces CMake to run again if given.
171 -DEXTRA_DTC_OVERLAY_FILE... cmake arguments: the results are
175 group.add_argument('--sysbuild', action='store_true',
177 group.add_argument('--no-sysbuild', action='store_true',
183 group.add_argument('-p', '--pristine', choices=['auto', 'always',
194 # Store legacy -s option locally
244 if (self.args.cmake or self.args.cmake_opts or
287 # A malformed CMake cache may exist, but not have a board.
310 # passed on to CMake
338 sysbuild = False
346 sysbuild = section.get('sysbuild', sysbuild)
368 if colon != -1:
372 'conditional config "{}". Add "-D{}" '
373 'to the supplied CMake arguments if '
376 args.append("-D{}".format(arg.replace('"', '\"')))
381 args = ["-D{}".format(a.replace('"', '\"')) for a in config_options]
382 … args.extend(["-D{}".format(arg.replace('"', '')) for arg in non_config_options])
401 self.args.sysbuild = sysbuild
418 args_expanded = ["-D{}".format(a.replace('"', '')) for a in args]
445 # If we created the build directory, we must run CMake.
447 # The CMake Cache has not been loaded yet, so this is safe
455 'your build.dir-fmt configuration option')
470 # implicitly from the build directory's CMake cache, or using the
488 'CMake cache has no CMAKE_HOME_DIRECTORY;',
498 'use --build-dir {} to specify a build directory'.
505 'did you mean --build-dir {srcrel} instead?'.
511 'want to build? (Use -s SOURCE_DIR to specify '
527 # CMake configuration phase.
545 # consistent with --source-dir.
552 'directory "{}" was specified; please clean it, use --pristine, '
553 'or use --build-dir to set another build directory'.
557 self.run_cmake = True # If they insist, we need to re-run cmake.
571 '(provide --board, set default with '
575 # Check consistency between cached board and --board.
581 '(Clean the directory, use --pristine, or use --build-dir to '
591 # Tricky corner-case: The user has not specified a build folder but
592 # there was one in the CMake cache. Since this is going to be
593 # invalidated, reset to CWD and re-run the basic tests.
603 '--board=<your-board>.')
613 cmake_opts = ['-DBOARD={}'.format(board)]
619 cmake_opts.append(f'-DSNIPPET={";".join(self.args.snippets)}')
621 cmake_opts.append(f'-DSHIELD={";".join(self.args.shields)}')
623 cmake_opts.append(f'-DEXTRA_CONF_FILE={";".join(self.args.extra_conf_files)}')
626 f'-DEXTRA_DTC_OVERLAY_FILE='
630 user_args = config_get('cmake-args', None)
634 config_sysbuild = config_getboolean('sysbuild', False)
635 if self.args.sysbuild or (config_sysbuild and not self.args.no_sysbuild):
636 cmake_opts.extend(['-S{}'.format(SYSBUILD_PROJ_DIR),
637 '-DAPP_DIR:PATH={}'.format(self.source_dir)])
639 # self.args.no_sysbuild == True or config sysbuild False
640 cmake_opts.extend(['-S{}'.format(self.source_dir)])
642 # Invoke CMake from the current working directory using the
643 # -S and -B options (officially introduced in CMake 3.13.0).
647 # west build -- -DOVERLAY_CONFIG=relative-path.conf
648 final_cmake_args = ['-DWEST_PYTHON={}'.format(pathlib.Path(sys.executable).as_posix()),
649 '-B{}'.format(self.build_dir),
650 '-G{}'.format(config_get('generator',
667 cmake_args = [f'-DBINARY_DIR={app_bin_dir}',
668 f'-DSOURCE_DIR={app_src_dir}',
669 '-P', cache['ZEPHYR_BASE'] + '/cmake/pristine.cmake']
677 extra_args = ['--target', target] if target else []
679 extra_args.append('--')
703 # These hacks are only needed for CMake versions earlier than
705 # drop this nonsense and just run "cmake --build BUILD -v".
712 # Substring matching is for things like "Eclipse CDT4 - Ninja".
715 extra_args.append('--')
716 extra_args.append('-v')
719 extra_args.append('--')