Skip to content

Template for rust development reusing static c libs

License

Notifications You must be signed in to change notification settings

phodina/rustify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux & Mac Build status
Windows Build status

Call C code in Rust Project

Template for porting/calling C code in Rust Project.

Overview

There are two directories with the source codes.

  • legacy - contains C code which is compiled into lib
  • src - contains Rust code which is compiled as application

Generation of the C bindings for Rust is done on-the-fly by Bindgen crate. The modules which should be compiled are speci

Usage

To build the project simply run:

cargo build

Here is example of several args you can pass:

cargo run -- -h

Say Hi
Hello from C!

cargo run -- -p

Missing name of the place. Falling to default.
We are at Prague!

cargo run -- -p London

We are at London!

cargo run -- -m

Multiply value: 6

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

  • Petr Hodina

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Template for rust development reusing static c libs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published