[hlc] automatic compilation with Ninja generator#726
[hlc] automatic compilation with Ninja generator#726Apprentice-Alchemist wants to merge 1 commit intoHaxeFoundation:masterfrom
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.
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.
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.