-
Notifications
You must be signed in to change notification settings - Fork 181
[hlc] automatic compilation with Ninja generator #726
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
base: master
Are you sure you want to change the base?
[hlc] automatic compilation with Ninja generator #726
Conversation
|
What's the status here? I'd be happy to give it a try! |
fa9713b to
5d0bdbe
Compare
|
Good enough to merge, not good enough to enable by default. Linux/macOS with an install in |
5d0bdbe to
41160d9
Compare
|
Other setups (including Windows) now work too. |
41160d9 to
928c651
Compare
| final libflags = config.libs.map((lib) -> switch lib { | ||
| case "std": "-lhl"; | ||
| case "uv": '$prefix/lib/$lib.hdll -luv'; | ||
| case var lib: '$prefix/lib/$lib.hdll'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An issue here on linux is that the libraries will always be loaded as this full path, so if the binaries are meant to be distributed as a relocatable set of binaries then it will fail to load it from $ORIGIN. This can be fixed if hdlls are always linked with --soname <name>.hdll, which is already the case with cmake but not with make. This would be a requirement for user made hdlls too.
Also, do we need additional -l flags for other hdlls like sdl etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the lack of soname/install name is a problem for relocatable builds, but let's leave that for another PR.
Also, do we need additional -l flags for other hdlls like sdl etc?
No, uv is the only one because the bindings use certain symbols from libuv directly.
The other libraries don't do that.
Ninja is a fast cross-platform build system designed for use-cases like this.
https://ninja-build.org/
Marking as a draft because this PR still needs some more testing to make sure it works on all platforms.