1

I use CMake to build win32 apps by using its Visual Studio 16 2019 generator and passing the following options:

cmake -G "Visual Studio 16 2019" -A Win32

I'd like to switch the Visual Studio 16 2019 generator with Ninja to build the same win32 app. However, CMake's Ninja generator does not offer the same high-level functionality as CMake's Visual Studio generators.

So, does anyone know how to configure Ninja to build win32 apps with the MSVC compiler?

RAM
  • 2,257
  • 2
  • 19
  • 41
  • You could use Ninja generator with MSVC compiler (`cl.exe`). Just pass proper variables `CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER` to `cmake`. If you want specific setup of `cl.exe` compiler, then see [that question](https://stackoverflow.com/questions/31262342/cmake-g-ninja-on-windows-specify-x64). – Tsyvarev Feb 12 '23 at 17:21

0 Answers0