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

Bindgen feature #34

Merged
merged 2 commits into from May 7, 2017
Merged

Bindgen feature #34

merged 2 commits into from May 7, 2017

Conversation

simonrw
Copy link
Owner

@simonrw simonrw commented May 7, 2017

Allow conditional compilation using compilation features

#33

@simonrw simonrw self-assigned this May 7, 2017
@simonrw
Copy link
Owner Author

simonrw commented May 7, 2017

I think the compilation to include this feature is slightly ungainly:

# "standard" compilation
cargo build

This is fair enough.

cargo build --no-default-features --features bindgen

This is quite a lot of typing. I don't know if there is a way of disables to be exclusive?

@simonrw
Copy link
Owner Author

simonrw commented May 7, 2017

rust-lang/cargo#2980

@simonrw
Copy link
Owner Author

simonrw commented May 7, 2017

Currently the bindgen feature is not tested on travis, but is tested on push with my local .git hook

@simonrw
Copy link
Owner Author

simonrw commented May 7, 2017

It turns out getting clang 3.9 on travis is a pain :(

@simonrw
Copy link
Owner Author

simonrw commented May 7, 2017

We need to add some documentation to the README

This swaps out compilation with `fitsio-sys` for compilation with
`fitsio-sys-bindgen`. This relies on the user having clang>=3.9
installed on their system.

Set up compilation for switching features (build error)

Ensure code compiles and tests pass

This mostly revolved around changing pointer types which were hard coded
to cast to libc::c_void, whereas in `fitsio-sys-bindgen` they were
`std::os::raw::c_void`. By using a wildcard cast (`_`) the code
automatically casts to the correct value for both libraries.

The other change was to move `MAX_VALUE_LENGTH` to `fitsio` rather than
the low level library.
@simonrw simonrw merged commit 28ff2ad into master May 7, 2017
@simonrw simonrw deleted the bindgen-feature branch May 7, 2017 20:53
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.

None yet

1 participant