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

Add option to decide output directory for CMake. #39

Open
gsa-tspaere opened this issue Dec 20, 2024 · 7 comments
Open

Add option to decide output directory for CMake. #39

gsa-tspaere opened this issue Dec 20, 2024 · 7 comments
Labels

Comments

@gsa-tspaere
Copy link

Hey!

I am using pixi-build with a cmake project, and I'm able to build it and everything, but I have a problem. I use compile_commands.json to use clangd in my editor, and I'm dependent on the output of the cmake build is in a predictable place, to be order to point it there.

For now I see no option to direct pixi, to do the building in a given directory. Is there anyway you could add support for this or some other special option to get the compile_commands.json out?

@tdejager
Copy link
Contributor

tdejager commented Jan 7, 2025

Yes! We can add the -DCMAKE_EXPORT_COMPILE_COMMANDS=ON option by default I think. Thank for giving this a test drive 🚗 🚤 !

@gsa-tspaere
Copy link
Author

Adding it by default is good, but the main problem is that we need some way to place it in a fixed place, so the user can point their clangd configuration to it :)

@tdejager
Copy link
Contributor

tdejager commented Jan 7, 2025

Yeah, indeed, so I don't know how you are using it, but we do re-use the build directory in the the .pixi folder :) the problem is that can dissappear whenever the backend decides but we could give that a first try maybe?

@tdejager
Copy link
Contributor

tdejager commented Jan 7, 2025

We've just merged: #51

Might be fun to give that a try with the next pixi release :)

@gsa-tspaere
Copy link
Author

Hey, that's very nice! Could you give me the name of the folder that is used for the build?

@tdejager
Copy link
Contributor

tdejager commented Jan 17, 2025

It should be in .pixi/build-v0/ and then the name of your project and some string. E.g for its this for some project:

.pixi/build-v0/cpp-sdl-rxtTGpY4RzI/bld/rattler-build_sdl_example/build

This contains the compile_commands.json.

It should re-use this folder across builds.

@gsa-tspaere
Copy link
Author

Hey! I will look into this, when I last looked, I was not able to find those files, but I am sure it was just me!

@baszalmstra baszalmstra added the Pixi label Mar 27, 2025 — with Linear
@baszalmstra baszalmstra added Build and removed Pixi labels Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants