Crate autocxx_engine
source ·Expand description
The core of the autocxx
engine, used by both the
autocxx_macro
and also code generators (e.g. autocxx_build
).
See IncludeCppEngine for general description of how this engine works.
Structs
Function to generate the desired name of the header containing autocxx’s
extra generated C++.
Newtype wrapper so we can give it a
Default
.Builder
build
An object to allow building of bindings from a
build.rs
file.BuilderSuccess
build
For test purposes only, a
cc::Build
and lists of Rust and C++
files generated.Options for C++ codegen
Some C++ content which should be written to disk and built.
Function to generate the desired name of the header containing cxx’s
declarations.
Newtype wrapper so we can give it a
Default
.All generated C++ content which should be written to disk.
Core of the autocxx engine.
A
syn::Error
which also implements miette::Diagnostic
so can be pretty-printed
to show the affected span of code.A Rust file parsed by autocxx. May contain zero or more autocxx ‘engines’,
i.e. the
IncludeCpp
class, corresponding to zero or more include_cpp
macros within this file. Also contains syn::Item
structures for all
the rest of the Rust code, such that it can be reconstituted if necessary.Opaque structure representing the Rust which needs to be generated
for a given
include_cpp!
macro. You will want to pass this into
either generate_rs_single
or generate_rs_archive
.Enums
BuilderError
build
Errors returned during creation of a
cc::Build
from an include_cxx
macro.Errors which may occur in generating bindings for these C++
functions.
Errors which may occur when parsing a Rust source file to discover
and interpret include_cxx macros.
Statics
The complete contents of the “rust/cxx.h” header.
Traits
BuilderContext
build
The context in which a builder object lives. Callbacks for various
purposes.
Implement to learn of header files which get included
by this build process, such that your build system can choose
to rerun the build process if any such file changes in future.
Functions
Creates an on-disk archive (actually a JSON file) of the Rust side of the bindings
for multiple
include_cpp
macros. If you use this, you will want to tell
autocxx_macro
how to find this file using the AUTOCXX_RS_ARCHIVE
environment variable.Gets the Rust code corresponding to a single
RsOutput
. You can write this
to a file which can simply be include!
ed by autocxx_macro
when you give
it the AUTOCXX_RS_FILE
environment variable.Get the path to clang which is effective for any preprocessing
operations done by autocxx.
Get clang args as if we were operating clang the same way as we operate
bindgen.
Parse a Rust file, and spot any include_cpp macros within it.
Preprocess a file using the same options
as is used by autocxx. Input: listing_path, output: preprocess_path.