corrosion-rs / corrosion

Marrying Rust and CMake - Easy Rust and C/C++ Integration!
https://corrosion-rs.github.io/corrosion/
MIT License
1.1k stars 106 forks source link

corrosion_add_cxxbridge: Add target to regenerate bridge files #577

Closed LeonMatthesKDAB closed 1 week ago

LeonMatthesKDAB commented 1 week ago

I'm currently using CXX with Corrosion on a project that is rather difficult to build outside of a docker container and also takes a long time to build.

To get good IDE completion with clangd however, clangd needs to be able to access the header files that are generated by CXX.

This PR allows users to specify a custom CMake target that will regenerate the cxx bridges without needing to recompile. That way, I can get good IDE completion without having to have a fully working build setup in and outside my docker container.

jschwe commented 1 week ago

Seems reasonable, thanks for the PR

LeonMatthesKDAB commented 1 week ago

@jschwe Thank you for the review. The issues you noticed should now be fixed :)