plasma-umass / cwhy

"See why!" Explains and suggests fixes for compile-time errors for C, C++, C#, Go, Java, LaTeX, PHP, Python, Ruby, Rust, and TypeScript
Apache License 2.0
272 stars 6 forks source link

CMake support #2

Closed vadi2 closed 1 year ago

vadi2 commented 1 year ago

Could CMake support be considered, so that you can just plug the tool into a codebase with FetchContent and it'll give you the handy explanations automatically?

emeryberger commented 1 year ago

I hadn't seen that but you could do this:

cmake 2> >(cwhy)

The above sends stderr to cwhy, which now does nothing if it receives no input.

vadi2 commented 1 year ago

That worked for the CLI! Any way to do the same in an IDE setup where cmake is invoked for you?

emeryberger commented 1 year ago

No doubt it is doable, but I imagine it varies considerably per IDE (and depends on where you want the results to appear). That said, we'd love to see integration into something like Visual Studio.

nicovank commented 1 year ago

Closing this as CWhy does not really work at the level where FetchContent would be appropriate. Our current CMake support is pretty good IMO.

% cmake -DCMAKE_CXX_COMPILER=`cwhy --llm=gpt-4 --wrapper --wrapper-compiler=clang++` ...