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

Way to programmatically generate a standalone release (or statically linked executable) #53

Open
lambdadog opened this issue Aug 26, 2019 · 2 comments

Comments

@lambdadog
Copy link

Is there a way I can either 1) take the executable I'm building and instruct bake to build all of its libraries as static libraries then link them into the executable, or 2) programmatically get all the libraries depended on so that I can copy them into a directory to bundle alongside of the executable for a standalone release?

I've looked into the various configuration options and haven't found anything yet in regards to doing either

While it would be possible to manually do it myself because I do generally know where bake keeps the libraries, it would be pretty helpful to not have to do this pretty major step in the release process of, say, a game, manually.

@SanderMertens
Copy link
Owner

SanderMertens commented Aug 26, 2019

This has been on my wishlist for a while, and maybe it's time to implement it. You can currently build static binaries by adding the static property and set it to true. You can then link with static libraries by specifying them in the static-lib property. Both properties should be added to lang.c, and are documented here: https://github.com/SanderMertens/bake/tree/master/drivers/lang/c

However, it would be (much) nicer if there were a command line option like --static or something that would compile the entire project as a self-contained binary. This is something that is definitely possible to do, but will take some time to build.

@lambdadog
Copy link
Author

How does the static-lib property interact with bake-managed dependencies, would I need to remove them from there first and would it be able to access them without any hacks?

Also, current documentation for the static property indicates that it only works with packages, meaning in bake-speak, libraries. I assume from what you're saying, that's changed?

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