Skip to content
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

Support CMake build on MSVC #176

Merged
merged 2 commits into from
Nov 30, 2019
Merged

Conversation

ghost
Copy link

@ghost ghost commented Nov 18, 2019

Builds on Windows with MSVC environment produce the library located at build/src/Release or build/src/Debug, instead of just build/src for other environments.

This PR explicitly handles this case. The choice between Release and Debug happens using the same logic as in cmake crate, see these lines.

Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
Signed-off-by: Alexander Rodin <rodin.alexander@gmail.com>
@benesch
Copy link
Collaborator

benesch commented Nov 29, 2019

For posterity, this works around what appears to be a long standing bug in the CMake crate: rust-lang/cmake-rs#18

@benesch benesch merged commit d3a5e8a into fede1024:master Nov 30, 2019
benesch added a commit to benesch/rust-rdkafka that referenced this pull request Dec 11, 2019
The approach in fede1024#176 to handle MSVC was flawed, as it did not properly
account for CMake's RelWithDebInfo configuration type. The correct
approach is to ask CMake to install the library, rather than just
building it, at which point the library will be at a stable path
(OUT_DIR/lib) regardless of the directory structure that the particular
CMake generator uses.

Fix fede1024#191.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants