Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to not pass -DCMAKE_EXPORT_COMPILE_COMMANDS=ON in the cmake invocation #760

Open
anarthal opened this issue Dec 4, 2024 · 2 comments
Assignees

Comments

@anarthal
Copy link

anarthal commented Dec 4, 2024

At the moment, mrdocs appends a -DCMAKE_EXPORT_COMPILE_COMMANDS=ON at the end of the command line. This might be too much for some projects, as it generates the compilation database for all targets in the project (as per the cmake docs).

I can't disable some of the targets built by my project, because they're added by dependencies. In this case, I'd like to set the EXPORT_COMPILE_COMMANDS manually for the target I'd like MrDocs to know about. This would allow me to generate a compile_commands.json that has only the targets relevant to MrDocs, without modifying my dependencies.

@anarthal
Copy link
Author

anarthal commented Dec 4, 2024

As noted by Peter, this can be solved by passing mrdocs options before user options, so they can be overriden. This would fix my issue.

@alandefreitas
Copy link
Collaborator

Also noted by peter, instead of an option, we could simply not change if it's there -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF.

@alandefreitas alandefreitas moved this to Accepted in MrDocs Dec 23, 2024
@alandefreitas alandefreitas self-assigned this Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Accepted
Development

No branches or pull requests

2 participants