Ninja: Broken build.ninja when build tree is a Windows drive root
Hi all,
Description:
In case of generating the ninja build solution in the root directory of any disk, CMake is adding a $
before :
or
(space)CMakeNinjaVS.zip.
Ninja build exmaple
...
#############################################
# Make the all target the default.
default all
#############################################
# Re-run CMake if any of its inputs changed.
build build.ninja: RERUN_CMAKE | C$:\Program$ Files\3rdPartyApps\cmake\share\cmake-3.16\Modules\CMakeCCompiler.cmake.in C$:\Program$ Files\3rdPartyApps\cmake\share\cmake-3.16\Modules\CMakeCCompilerABI.c ...
#############################################
# A missing CMake input file is not an error.
build C$:\Program$ Files\3rdPartyApps\cmake\share\cmake-3.16\Modules\CMakeCCompiler.cmake.in C$:\Program$ Files\3rdPartyApps\cmake\share\cmake-3.16\Modules\CMakeCCompilerABI.c C$:\Program$ Files\3rdPartyApps\cmake\share\cmake-3.16\Modules\CMakeCInformation.cmake ...
...
Environment
CMake: 3.16.4 Ninja: 1.10.0 Windows: Windows 10 Pro 1909 (OS build: 18363.693)
How to reproduce Attached you have an zip with a small test project that creates a virtual drive, W:, and generate the ninja project and tries to build it. It uses Visual Studio for it and it is necessary to have vswhere.exe in your environment path as is using to find the Visual Studio installation path.
PS: This has been reported to ninja issue board also https://github.com/ninja-build/ninja/issues/1747
Edited by Brad King