Skip to content

Commit

Permalink
docs: Add C/C++ include paths use examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenexp committed Feb 15, 2024
1 parent e07fcfa commit 81b3324
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,20 @@ fn main() {
.emit();
}
```

## Getting C/C++ include paths from Conan dependencies

To use the list of include paths, do the following after
parsing the `conan install` output:

```rust
use conan2::ConanInstall;

let metadata = ConanInstall::new().run().parse();

for path in metadata.include_paths() {
// Add "-I{path}" to CXXFLAGS or something.
}

metadata.emit();
```
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@
//! .parse()
//! .emit();
//! ```
//!
//! ## Getting C/C++ include paths from Conan dependencies
//!
//! To use the list of include paths, do the following after
//! parsing the `conan install` output:
//!
//! ```no_run
//! use conan2::ConanInstall;
//!
//! let metadata = ConanInstall::new().run().parse();
//!
//! for path in metadata.include_paths() {
//! // Add "-I{path}" to CXXFLAGS or something.
//! }
//!
//! metadata.emit();
//! ```
#![deny(missing_docs)]

Expand Down

0 comments on commit 81b3324

Please sign in to comment.