Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCan I point to a compile_commands.json out-of-source? #50
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vanjoe
Aug 23, 2018
As far as I can tell it only looks for a compile_commands.json or a builds/compile_commands.json in a directory that is (grand-)*parent of the file. I also find this a bit annoying because for various reasons I don't always call my build directory "build"
vanjoe
commented
Aug 23, 2018
|
As far as I can tell it only looks for a compile_commands.json or a builds/compile_commands.json in a directory that is (grand-)*parent of the file. I also find this a bit annoying because for various reasons I don't always call my build directory "build" |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
geokon-gh
Aug 24, 2018
Hmmm, yeah. I'm trying to see if I can somehow patch it in.
@vanjoe are you looking at this line? https://github.com/cquery-project/emacs-cquery/blob/master/cquery.el#L115
I'm not so hot with ELisp macros... I can't really tell where it goes from here
geokon-gh
commented
Aug 24, 2018
•
|
Hmmm, yeah. I'm trying to see if I can somehow patch it in. @vanjoe are you looking at this line? https://github.com/cquery-project/emacs-cquery/blob/master/cquery.el#L115 I'm not so hot with ELisp macros... I can't really tell where it goes from here |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dscole
Sep 4, 2018
@geokon-gh I just create a symlink:
ln -s path/to/build/dir/compile_commands.json -rt /path/to/project/root
dscole
commented
Sep 4, 2018
|
@geokon-gh I just create a symlink:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
geokon-gh
Sep 10, 2018
@dscole Yeah, that a quick hack that works. Thanks :)
I realize there is no real obvious way to easily automate this (b/c there is no CMake build tool in Emacs as of yet) - but I'd like to be able to just have the ability to redirect the compile_commands.json from within Emacs/Cquery. It'd make the workflow a lot smoother and easier to automate. Having to make a new simlink each time I make a new build directory is less clean (and if you make many build directories it's a bit impractical)
geokon-gh
commented
Sep 10, 2018
|
@dscole Yeah, that a quick hack that works. Thanks :) I realize there is no real obvious way to easily automate this (b/c there is no CMake build tool in Emacs as of yet) - but I'd like to be able to just have the ability to redirect the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
You can use the compilationDatabaseDirectory init option for this. |
geokon-gh commentedAug 22, 2018
So I thought this was more common, but I have everything setup to build out-of-source using CMake. (My source actually lives on a USB drive and I move it from machine to machine)
To make it more concrete:
I have my code in
/home/geokon/USB/Projects/someprojectSo there will be a
/home/geokon/USB/Projects/someproject/CMakeLists.txtand some folder with my source files like/home/geokon/USB/Projects/someproject/srcBut I'm building somewhere completely else like
/home/geokon/SomeBuildAreaand it'll have a
/home/geokon/SomeBuildArea/CMakeCache.txt/home/geokon/SomeBuildArea/compile_commands.jsonand libs, binaries etc.
So can I somehow tell cquery the path to a
compile_commands.jsonfor a source tree somewhere completely else? Or do I set the project root to be the build directory and it will magically work with all my source files that aren't actually under the same file root?I could make some hack to move the
compile_commands.jsonto the source directory.. but I'd like to really avoid doing that.Thanks! This is a really awesome project. Hope I can get it working for my setup :)