Skip to content

When running west zephyr-export on Windows, the command fails if nmake is not in the PATH, even if ninja is installed and available #100150

@MOYUtianming

Description

@MOYUtianming

Describe the bug

This is because the underlying cmake command is invoked without a -G generator argument, causing CMake to default to "NMake Makefiles" on Windows.

Regression

  • This is a regression.

Steps to reproduce

  1. On a Windows machine with ninja installed but without Visual Studio build tools (nmake) in the PATH.
  2. follow the steps for install zephyr on windows in https://docs.zephyrproject.org/latest/develop/getting_started/index.html until Run west zephyr-export.

Relevant log output

FATAL ERROR: command exited with status 1: '.../cmake.EXE' -S '...' -B '...'
CMake Error at CMakeLists.txt:12 (project):
  Running
   'nmake' '-?'
  failed with:
   no such file or directory

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

OS: Windows
Toolchain: Zephyr SDK, CMake, Ninja

Additional Context

Using a PowerShell command line in a format similar to the one below:
& 'C:\Program Files\CMake\bin\cmake.EXE' -S '\zephyrproject\zephyr\share\zephyr-packge\cmake' -B '\zephyrproject\zephyr\share\zephyr-packge\cmake' -G Ninja
to replace
west zephyr-export
allows this step to be successfully completed in this installation.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions