<LANG_ID>_<TOOL>_LAUNCHER target property should be ignored if blank
If a target's <LANG_ID>_<TOOL>_LAUNCHER
evaluates to a blank string, then it should be ignored and the default tool should be used instead.
Here's the use case: You use the ccache
compiler cache by setting a target's CXX_LINKER_LAUNCHER
property, but ccache
only supports certain compilers. So we'd use a generator expression to enable it conditionally.
For example:
set_property(
TARGET your_exe_here
PROPERTY CXX_LINKER_LAUNCHER
"$<$<COMPILE_LANG_AND_ID:CXX,GNU,Clang,NVIDIA>:ccache>")
But if the compiler is not supported--if generator expression evaluates to an empty string--CMake tries to execute "" as an actual command. It seems it would be more sensible to ignore a blank string and go on to use the default exe.
Edited by midrare