-
Notifications
You must be signed in to change notification settings - Fork 47
Can't override build script to use existing libtcod #299
Comments
Judging by the warning, it looks like you put it in I'm not able to actually test any of this now, but FWIW when I was playing with local overrides in a different project, I used these options instead of [target.x86_64-unknown-linux-gnu.SDL2]
rustc-link-search = ["lib/x86_64-linux-gnu"]
rustc-link-lib = ["SDL2"] (and I had a So try something like this: [target.x86_64-unknown-linux-gnu.tcod]
rustc-link-search = ["/usr/lib/tcod"]
rustc-link-lib = ["tcod"] Putting in the absolute path to the directory where the |
Thank you, I'm still learning about cargo and didn't know about its configuration (for the record, the Rust Book chapter on configuration). I can also confirm successful compilation with Also I'm actually trying to compile on NixOS, which means the path to the library changes with every update so I'd like to rely on an environment variable but I don't know how to do that with cargo. |
I see rust-sdl2 uses pkg-config to figure out where SDL2 is, maybe we could do the same for |
That's great to hear! Have you tried with
https://github.com/tomassedovic/tcod-rs/blob/master/tcod_sys/build.rs I'll be happy to check the PR if you put it up (though it may take some time, sorry about that). I won't have the time to write it myself unfortunately :-(. |
(we should still support building libtcod as a fallback, but yeah if pkg-config finds it, let's just use that instead) |
Not exactly, but I bet it would work as well.
I know, but I think using
Great, I'll open a new issue and start working on a PR.
Ofc, that was a given. So, if I manage to make the build detect libtcod through pgk-config, should we remove the manual override section of the README and the |
(Btw, just confirmed working with |
Actually, the libtcod package on NixOS is missing the pgkconfig declaration so pkg-config won't help me for what I'm trying to accomplish there... I was thinking on maybe reading an env var in the build script to allow easy override? (dynamically writing the path to |
This project has not been maintained for a few years. I'm closing all pull requests and issues before archiving the repo on github. Sorry I hadn't done this sooner! |
I've tried to use the libtcod provided by my distro,
but unfortunately cargo gives me the following warning
and compilation fails when pkg-config is not found.
The text was updated successfully, but these errors were encountered: