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

Consider adding --debug and --release flags to the build command #56

Closed
thoughton opened this issue Apr 2, 2018 · 6 comments
Closed

Comments

@thoughton
Copy link

Hi,

Would it be possible to consider adding --debug and --release flags to the build command, similar to those that already exist for install?

It's of course possible that I'm trying to use cget wrong, but my use-case is that I'm using cget to build my local project (in addition to installing and building its dependencies), and I'd like to optionally build it with debug symbols occasionally.

I was a bit surprised there was no --debug flag for the build command, so as a workaround I tried passing in a custom --define CMAKE_BUILD_TYPE=Debug to the command instead, however that also didn't work due to the issue I've detailed in #55.

So for now I've resorted to simply adding a set(CMAKE_BUILD_TYPE Debug) line to my local package's CMakeLists.txt file. However this is not ideal as I would prefer to be able to toggle it within the cget command line rather than having to edit a file.

Thanks!

@pfultz2
Copy link
Owner

pfultz2 commented Apr 2, 2018

That sounds like a good idea.

@pfultz2
Copy link
Owner

pfultz2 commented Apr 22, 2018

This has been added to master branch.

@pfultz2 pfultz2 closed this as completed Apr 22, 2018
@thoughton
Copy link
Author

Hi @pfultz2, I've only just got around to trying this out on master branch (sorry it took so long!) but I'm afraid I seem to be having a bit of an issue.

I have a simple project that includes one library in its requirements file.

When I build the project with cget build --debug, it looks like the debug setting is only being applied to the library, but not the project itself.

I've somewhat verified this with the --verbose flag.

When building with that flag, I can see that the library's cmake command contains the -DCMAKE_BUILD_TYPE=Debug flag (as expected).

However, the cmake command for the project itself still contains the -DCMAKE_BUILD_TYPE=Release flag - which I think is incorrect?

@pfultz2 pfultz2 reopened this May 7, 2018
@pfultz2
Copy link
Owner

pfultz2 commented May 7, 2018

Let me look into this.

@pfultz2
Copy link
Owner

pfultz2 commented May 25, 2018

So I pushed a fix for this on master.

@thoughton
Copy link
Author

Just tested it and it works great - thanks!

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

No branches or pull requests

2 participants