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

Cmake build integration #1

Open
tgross35 opened this issue Feb 5, 2023 · 0 comments
Open

Cmake build integration #1

tgross35 opened this issue Feb 5, 2023 · 0 comments

Comments

@tgross35
Copy link

tgross35 commented Feb 5, 2023

I think this would look like the following:

  • Add a MYSQL_ADD_RUST_PLUGIN macro
  • Macro should check that cargo is available, possibly validate version (not sure what our MSRV is here but I think 1.65 is probably reasonable)
  • Dynamic: cargo rustc --manifest-path rust/somepath/Cargo.toml --target-dir rust/target --crate-type=cdylib
  • Static: cargo rustc --manifest-path rust/somepath/Cargo.toml --target-dir rust/target --crate-type=staticlib -- --cfg make_static_lib
  • --release or based on whether it's a debug build
  • Output is in rust/target/debug/ or rust/target/release (can also rename)

Not sure how to handle C code dependency and communicate that with the build system for dynamic, but for static I think it would just work

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

No branches or pull requests

1 participant