• Brad King's avatar
    add_custom_{command,target}: Fix crash on empty expanded command · 6e594916
    Brad King authored
    Our custom command generation logic assumes that all command lines have
    at least `argv0`.  In `add_custom_{command,target}` we already check
    that at least a `COMMAND` was given, but using `COMMAND_EXPAND_LISTS` in
    combination with a generator expression that expands to an empty string
    may produce an empty command line.  In this case simply add an empty
    string as a command to maintain our internal invariant.
    
    Fixes: #17993
    6e594916
Name
Last commit
Last update
..
BadTargetName-result.txt Loading commit data...
BadTargetName-stderr.txt Loading commit data...
BadTargetName.cmake Loading commit data...
ByproductsNoCommand-result.txt Loading commit data...
ByproductsNoCommand-stderr.txt Loading commit data...
ByproductsNoCommand.cmake Loading commit data...
CMakeLists.txt Loading commit data...
CommandExpandsEmpty.cmake Loading commit data...
NoArguments-result.txt Loading commit data...
NoArguments-stderr.txt Loading commit data...
NoArguments.cmake Loading commit data...
RunCMakeTest.cmake Loading commit data...
TargetOrder.cmake Loading commit data...
UsesTerminalNoCommand-result.txt Loading commit data...
UsesTerminalNoCommand-stderr.txt Loading commit data...
UsesTerminalNoCommand.cmake Loading commit data...