Skip to content
Permalink
Browse files

west: build: Use officially documented CMake options

The -B option has always existed but was first officially documented in
CMake 3.13.0. In that same release the -S option was introduced,
replacing the old undocumented -H. Switch to using the officially
documented options.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
  • Loading branch information...
carlescufi authored and nashif committed Apr 14, 2019
1 parent 22a624a commit 3c6584d6d5f293894bb7dd17269fb4172e5520ce
Showing with 5 additions and 8 deletions.
  1. +5 −8 scripts/west_commands/build.py
@@ -298,17 +298,14 @@ def _run_cmake(self, cmake_opts):
log.dbg('not running cmake; build system is present')
return

# It's unfortunate to have to use the undocumented -B and -H
# options to set the source and binary directories.
#
# However, it's the only known way to set that directory and
# run CMake from the current working directory. This is
# important because users expect invocations like this to Just
# Work:
# Invoke CMake from the current working directory using the
# -S and -B options (officially introduced in CMake 3.13.0).
# This is important because users expect invocations like this
# to Just Work:
#
# west build -- -DOVERLAY_CONFIG=relative-path.conf
final_cmake_args = ['-B{}'.format(self.build_dir),
'-H{}'.format(self.source_dir),
'-S{}'.format(self.source_dir),
'-G{}'.format(DEFAULT_CMAKE_GENERATOR)]
if self.args.board:
final_cmake_args.append('-DBOARD={}'.format(self.args.board))

0 comments on commit 3c6584d

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