Closed laanwj closed 5 years ago
I agree, this would be a great usability win.
Unfortunately, I don't really have the time and knowledge to investigate this at the moment. Do you? I'd be happy to help in any way I can and I would love to accept a pull request that implements it.
Sure!
I can't promise how soon, but I'm willing to look at this.
Awesome, thanks!
I looked into it, it's easy enough to make it link to an .a
instead of an .so
, as well as to add println!("cargo:rustc-link-lib=dylib=SDL2");
to specify SDL2 as a dependency for linking libraries.
However, it looks like rust insists on passing the order of the linker arguments as "-l" "SDL2" "-l" "tcod"
which is the wrong way around, so I get screens full of symbol errors. Nothing that I tried could make it work.
Oh, never mind, I think I have it, I didn't know pkg_config::find_library("sdl2")
would add the library automatically.
The PR above is merged, I'm closing this issue. Thanks so much for doing this @laanwj!
It's currently a bit of a pain to run examples and applications using the library at the moment due to the
libtcod.so
dependency at run time.I think statically linking the internal libtcod (e.g. as a
.a
) could avoid this and make the resulting executables self-contained, of course apart from system libraries such as SDL.