Hi Dylan, thanks for taking the time to answer. On the CMake-side of things, from what I understand Ninja projects do not support .i targets (https://gitlab.kitware.com/cmake/cmake/-/issues/13838). Also it is quite cumbersome to be adding preprocessor targets manually on every CMakeLists in projects. So unfortunately, tinkering with CMake does not seem to be an optimal solution.
What would be extremely useful from Visual Studio would be provide easy ways of doing this in tasks.vs.json. In fact, I suspect there might already be a convenient, possibly undocumented, alternative to the following:
Here is my very tedious entry to tasks.vs.json:
{
"taskLabel": "Preprocess to File",
"appliesTo": "/*.cpp",
"type": "launch",
"command": "clang-cl.exe",
"args": [
"/nologo",
"-TP",
"-I..\\\\..\\\\..\\\\",
"-IC:\\\\usr\\\\include\\\\boost-1_71",
.... [ 10s of other flags ]
"-std:c++latest",
"-E",
"${file}",
">${file}.i"
]
},
This is super cumbersome, as I have to run build once with -v flag, capture the output, copy-paste all compilation flags, and add -E etc.
Is there anything that can be done to ease this situation a bit?
Thanks
slymz