Skip to content

Commit 3c6584d

Browse files
carlescufinashif
authored andcommitted
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 <[email protected]>
1 parent 22a624a commit 3c6584d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

scripts/west_commands/build.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,14 @@ def _run_cmake(self, cmake_opts):
298298
log.dbg('not running cmake; build system is present')
299299
return
300300

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

0 commit comments

Comments
 (0)