Generating Blender project with CMake and Ninja fails

Hi everyone,

I am trying to write a batch script to update blender source code and compile it, and it is working fine with CMake only. But the issue comes up when I try to use Ninja to speedup the process, here is the command that fails :
cmake -GNinja -S D:/prog/blender_git/blender -B D:/prog/blender_git/branches/master_branch_ninja

And here is the error :

– The C compiler identification is MSVC 19.26.28806.0
– The CXX compiler identification is MSVC 19.26.28806.0
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe – broken
CMake Error at D:/softwares/CMake/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler

"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: D:/prog/blender_git/branches/master_branch_ninja/CMakeFiles/CMakeTmp

Run Build Command(s):D:/softwares/ninja/ninja.exe cmTC_d1e30
[1/2] Building C object CMakeFiles\cmTC_d1e30.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_d1e30.exe
FAILED: cmTC_d1e30.exe
cmd.exe /C "cd . && D:\softwares\CMake\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_d1e30.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests  -- C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1426~1.288\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_d1e30.dir\testCCompiler.c.obj  /out:cmTC_d1e30.exe /implib:cmTC_d1e30.lib /pdb:cmTC_d1e30.pdb /version:0.0  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /foCMakeFiles\cmTC_d1e30.dir/manifest.res CMakeFiles\cmTC_d1e30.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the file specified
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:115 (project)

– Configuring incomplete, errors occurred!
See also “D:/prog/blender_git/branches/master_branch_ninja/CMakeFiles/CMakeOutput.log”.
See also “D:/prog/blender_git/branches/master_branch_ninja/CMakeFiles/CMakeError.log”.

Do you have any idea where that could come from ?

After researching on the internet I found that it could come from the missing rc.exe in my path, but I tried to add it but still have the same issue.

Let me know if you have any clue :slight_smile:

Cheers !