https://github.com/vmchale/cpp-build
Use the C pre-processor on Rust projects
https://github.com/vmchale/cpp-build
c c-preprocessor rust
Last synced: 6 months ago
JSON representation
Use the C pre-processor on Rust projects
- Host: GitHub
- URL: https://github.com/vmchale/cpp-build
- Owner: vmchale
- License: bsd-3-clause
- Created: 2020-10-11T16:32:55.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-02-04T00:30:36.000Z (almost 2 years ago)
- Last Synced: 2025-06-27T21:05:59.199Z (7 months ago)
- Topics: c, c-preprocessor, rust
- Language: Rust
- Homepage:
- Size: 47.9 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cpp-rs
Put this in your `build.rs` to use the C pre-processor with Rust.
## Example Use
```rust
fn main() {
walk_dir("src")
}
```
This will pre-process any `.cpprs` source files in `src/` using
the system C compiler.
See the [lzo-macros](https://github.com/vmchale/cpp-build/tree/main/lzo-macros)
example.
## Known Defects
The C pre-processor will discard any lines beginning with `#`, so that e.g.
```
#[macro_use]
```
would be thrown away.