I'm VERY new to all of the LibTooling stuff. I just thought I'd check
it out yesterday and I found the following issue. I don't know if this
is me doing something wrong or what, but...
I wanted to use LibTooling on Windows with a generic project. I
created a single directory as a test that just had input_test.cpp
which basically contained only an empty main function. Then, I created
a CMakeLists.txt file for it. I understand that the next step is
creating the .json file (this is the part where I suspect maybe
there's a better way?), so I tried using
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON. This didn't export any json since
it was building a Visual Studio project. So, I used -g "NMake
Makefiles". This seemed to successfully export the .json file.
However, I got all kinds of errors when trying to use LibTooling on
it. The reason is that it generated a json file that looked like this:
"command": "C:\\PROGRA~2\\MICROS~2.0\\VC\\bin\\cl.exe @<<
/nologo -g -Wall /MD /O2 /Ob2 /D NDEBUG
When I modified the .json file manually to look this, it worked:
"command": "C:/PROGRA~2/MICROS~2.0/VC/bin/cl.exe /nologo -g -Wall
/MD /O2 /Ob2 /D NDEBUG -IC:/path/to/project/$(INPUTTEST_SOURCE_DIR)
I don't know what the whole multi-line @<< stuff is about but that
seems to be what's causing the issue. Does anyone else have any
experience with this or a better way for me to set this up?