You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't thought about the exact syntax but obviously the goal is to allow something like #[cfg(cxx_ifdef = ENABLE_FEATURE)] which can disable a block of code in Rust.
I also haven't thought about #if but that should be achievable in a similar fashion. Probably.
This should be simple for the build.rs case but we need to figure out:
How to do this for the non-Cargo case (https://github.com/google/autocxx/tree/main/gen/cmd) in a way that's easy to integrate into third party build systems. We probably need to write all the extra rustc arguments to a file which build systems can use as input to a subsequent rustc command line.
How on earth to do this for the integration tests where we just don't launch another rustc instance at all. I don't have a plan there.
I'm also concerned that the sheer number of #define symbols are likely to overwhelm the rustc command line so we may need to be selective.
The text was updated successfully, but these errors were encountered:
Pull request #74 removes a file, preprocessor_parse_callbacks.rs, which had a lot of the code required to make this work. We should reinstate parts of that file when fixing this issue.
It's my intention that we can support Rust compile-time feature enablement based on C++ macros.
Where users are using our
build.rs
support in https://github.com/google/autocxx/tree/main/gen/build this should really be pretty trivial by printingcargo:rustc-cfg
lines to standard out as we're generating the C++ bindings.I haven't thought about the exact syntax but obviously the goal is to allow something like
#[cfg(cxx_ifdef = ENABLE_FEATURE)]
which can disable a block of code in Rust.I also haven't thought about
#if
but that should be achievable in a similar fashion. Probably.This should be simple for the
build.rs
case but we need to figure out:I'm also concerned that the sheer number of
#define
symbols are likely to overwhelm the rustc command line so we may need to be selective.The text was updated successfully, but these errors were encountered: