aboutsummaryrefslogtreecommitdiffstats
path: root/build.rs
AgeCommit message (Collapse)Author
2018-11-22Add licenseTeddy Wing
2018-10-29build.rs: Remove unused `cbindgen::Language` importTeddy Wing
All 'cbindgen' configs have been moved to 'cbindgen.toml'.
2018-10-14Compile and link 'libdome_key_event_source_simulator'Teddy Wing
Turn this into a build dependency with Make. Use Vladimir Matveev (https://stackoverflow.com/users/788207/vladimir-matveev) and Shepmaster's (https://stackoverflow.com/users/155423/shepmaster) answer on Stack Overflow to sort out getting Cargo the search path for the static library: https://stackoverflow.com/questions/26246849/how-to-i-tell-rust-where-to-look-for-a-static-library/26254062#26254062 For some reason I wasn't able to get it to work by just putting the library into `./target/debug/deps/`. I had to explicitly tell Cargo to put that in the search path. Also, we need to use `std::env` instead of the `env!` macro to get the `PROFILE` environment variable, otherwise it won't be initialised at the right time, as described in the Rust docs: > Because these variables are not yet set when the build script is > compiled, the above example using env! won't work and instead you'll > need to retrieve the values when the build script is run (https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
2018-08-25Generate a partial C header for our FFI APITeddy Wing
* Add the 'cbindgen' crate to help us auto-generate a C header for our exported FFI enums/structs/functions * Add a `build.rs` to generate the C header using cbindgen * Add a rough config for 'cbindgen' * Export everything from the `cocoa_bridge` crate to include the `KeyActionResult` struct * Commit the C header generated by 'cbindgen' Looks promising. We do, however, have some things to correct. We can't use `Option` in C, for instance, so we'll need to fix that in our `KeyActionResult`. Similarly, we need to rework the `run_key_action()` function to make it accessible as a C interface. Right now it returns an `Option`, which isn't going to work, and I'm not sure if the slice input translates. That (any maybe more) is why it doesn't get generated by 'cbindgen' into the header output file.