Ninja Multi-Config: hard crash when genex leaves add_custom_command OUTPUT empty
Example:
cmake_minimum_required(VERSION 3.20)
project(test NONE)
add_custom_command(OUTPUT $<$<CONFIG:Debug>:debug.txt>
COMMAND echo foo > debug.txt)
add_custom_target(genFiles ALL DEPENDS "$<$<CONFIG:Debug>:${CMAKE_CURRENT_BINARY_DIR}/debug.txt>")
At the console:
D:\output-gen>cmake -G "Ninja Multi-Config" -S . -B build
-- Configuring done
D:\output-gen>dir build
Volume in drive D is Sources
Volume Serial Number is 943F-828D
Directory of D:\output-gen\build
03/25/2021 04:22 PM <DIR> .
03/25/2021 04:22 PM <DIR> ..
03/25/2021 04:22 PM 0 build-Debug.ninja.tmp601a3
03/25/2021 04:22 PM 0 build-Release.ninja.tmp40cb0
03/25/2021 04:22 PM 0 build-RelWithDebInfo.ninja.tmp379e5
03/25/2021 04:22 PM 471 build.ninja
03/25/2021 04:22 PM 0 build.ninja.tmpce904
03/25/2021 04:22 PM 4,135 CMakeCache.txt
03/25/2021 04:22 PM <DIR> CMakeFiles
03/25/2021 04:22 PM 1,407 cmake_install.cmake
7 File(s) 6,013 bytes
3 Dir(s) 415,645,818,880 bytes free
Discovered while trying to fix #21983 (closed)