diff --git a/gen/README.md b/gen/README.md index 9786911b2..50adeca88 100644 --- a/gen/README.md +++ b/gen/README.md @@ -2,3 +2,6 @@ This directory contains CXX's C++ code generator. This code generator has two public frontends, one a command-line application (binary) in the *cmd* directory and the other a library intended to be used from a build.rs in the *build* directory. + +There's also a 'lib' frontend which is intended to allow higher level code generators +to embed cxx. This is not yet recommended for general use. diff --git a/gen/lib/src/lib.rs b/gen/lib/src/lib.rs index dae7e7869..ecfa4361a 100644 --- a/gen/lib/src/lib.rs +++ b/gen/lib/src/lib.rs @@ -20,6 +20,7 @@ mod gen; mod syntax; pub use crate::error::Error; +pub use crate::gen::include::HEADER; pub use crate::gen::{GeneratedCode, Opt}; use proc_macro2::TokenStream; diff --git a/gen/src/include.rs b/gen/src/include.rs index 1688a4e3d..3255902ad 100644 --- a/gen/src/include.rs +++ b/gen/src/include.rs @@ -1,6 +1,7 @@ use crate::gen::out::OutFile; use std::fmt::{self, Display}; +/// The complete contents of the "rust/cxx.h" header. pub static HEADER: &str = include_str!("include/cxx.h"); pub(super) fn write(out: &mut OutFile, needed: bool, guard: &str) {