Skip to content
Browse files

scripts: add build.generator config option for west build

This can be used to override the default CMake generator
permanently. Its values are the same as those acceptable to cmake's -G

Signed-off-by: Marti Bolivar <>
  • Loading branch information...
mbolivar authored and nashif committed May 1, 2019
1 parent 1f5e6d8 commit bbe890ab30b8222cf028f9140245f4f188c74e47
Showing with 11 additions and 1 deletion.
  1. +9 −0 doc/guides/west/build-flash-debug.rst
  2. +2 −1 scripts/west_commands/
@@ -109,6 +109,8 @@ To let west decide for you if a pristine build is needed, use ``-p auto``::
You can run ``west config build.pristine auto`` to make this setting

.. _west-building-generator:

To add additional arguments to the CMake invocation performed by ``west
build``, pass them after a ``--`` at the end of the command line.

@@ -160,6 +162,10 @@ You can :ref:`configure <west-config-cmd>` ``west build`` using these options.
* - ``build.board_warn``
- Boolean, default ``true``. If ``false``, disables warnings when
``west build`` can't figure out the target board.
* - ``build.generator``
- String, default ``Ninja``. The `CMake Generator`_ to use to create a
build system. (To set a generator for a single build, see the
:ref:`above example <west-building-generator>`)
* - ``build.pristine``
- String. Controls the way in which ``west build`` may clean the build
folder before building. Can take the following values:
@@ -443,3 +449,6 @@ commands do it).


.. _CMake Generator:
@@ -403,7 +403,8 @@ def _run_cmake(self, board, origin, cmake_opts):
# west build -- -DOVERLAY_CONFIG=relative-path.conf
final_cmake_args = ['-B{}'.format(self.build_dir),
if cmake_opts:

0 comments on commit bbe890a

Please sign in to comment.
You can’t perform that action at this time.