Skip to content

Conversation

@muff1nman
Copy link

I wanted to be able to use out of tree builds with cmake, and not have to worry about copying over the compile_commands.json file. In this branch, you are now able to specify a filename to search for. In my case, I can specify:

let g:clang_auto_user_options = 'compile_commands.json'
let g:clang_compilation_database_search_path = 'build/compile_commands.json'

which will properly find all the header files based on my cmake configurations.

Now the the code isn't exactly perfect. As you can see above, I kept how the clang_auto_user_options worked for backwards compatabilty and decided to add two new global variables for specifying the search path. The other variable is for the .clang_complete search path (g:clang_complete_search_path). Im not sure if changing the path for .clang_complete is as helpful but I figured we should keep the logic the same.

@muff1nman
Copy link
Author

Any update on this? Thanks!

For both compile_commands.json and .clang_complete, there were added some global
variables to allow the user to customize where to find these files.
@xavierd
Copy link
Owner

xavierd commented Feb 15, 2014

I would prefer if you only add one configuration that specify the search path for both .clang_complete and compile_commands.json. Can you also rebase and squash all of those commits, and test with the autochdir option set?

Thanks,
Xavier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants