-
Notifications
You must be signed in to change notification settings - Fork 14
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
Locate static cbc libs on windows via CBC_ROOT #28
Conversation
I don't know windows compilation procedure. But as it is better than before and can't be worst, I'm OK to merge this. I wait a bit if there is some review from the community. I'll merge it next week. Feel free to remind me if I forget by pinging me in this thread. Thanks for the contribution! |
@Thell was this closed intentionally? I am quite interested in compiling for Windows with statically-linked Cbc |
println!(r"cargo:rustc-link-lib=static=Osi"); | ||
println!(r"cargo:rustc-link-lib=static=OsiClp"); | ||
println!(r"cargo:rustc-link-lib=static=zlib"); | ||
() |
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.
This line seems unnecessary
I was cleaning up repos in my account and thought that the pull request had the needed pieces. |
coin_cbc_sys/src/lib.rs
Outdated
#[link(name = "CbcSolver")] | ||
#[cfg_attr( | ||
target_family = "windows", | ||
link(name = "libCbcSolver", kind = "static") |
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.
Seems to still work fine if you drop kind = "static"
; should it really be forced?
This uses std::env to check for CBC_ROOT on windows family targets an use that path for the search path for cbc libraries as named in the coin-or Cbc releases for windows (mscvXX) builds and sets the link
kind="static"
for linking.If CBC_ROOT is not found a
cargo:warning
is emitted instead of a panic so it won't interfere with any existing windows build work-arounds.