Ninja: COMMAND_EXPAND_LISTS leads to truncation of data in generated files
There is an issue with COMMAND_EXPAND_LISTS in a custom command. This works fine on Windows 10, but not Windows Server 2012 or Windows Server 2016. This happens with both cmake 3.22.6 and 3.24.1. It does not occur on Linux.
To reproduce, I used the following
- cmake 3.24.1 (or 3.22.6) on PATH
- Visual Studio 2017 command prompt (the C files are very simple, so it's not the case you will need the latest Visual Studio to get certain standards compliance.)
- Ninja 1.11.0 (happens with Ninja 1.10.0 as well) on PATH
- Python 3.7 or higher (I tested with Python 3.7 and use features of it - f"" strings in particular).
There is a reproducer script (do_it.bat
) in the ZIP file for ease of running this.
The problem will be during the link phase - the linker will complain about an object file that is missing, and that's because a path for that object file in the generated response file is not right.
I have not tried other generators, but I'd rather this be fixed when using the ninja generator as that is what we use for building our product.
Also, I am aware of others means of doing this (which I might have to do given time constraints), but I figured I may have found a bug in cmake so I thought I'd report it.
Thanks,
Tom