mystor / rust-cpp

Embed C++ directly inside your rust code!
Apache License 2.0
798 stars 44 forks source link

cpp_synmap support for parsing source files from include! macro calls #27

Open dylanede opened 6 years ago

dylanede commented 6 years ago

In theory this would just be a case of Walker detecting include macro calls in its Folder implementation. Initially it could be limited to handling includes of the form

include!(concat!(env!("OUT_DIR"), "/path/to/source/file.rs"));

The main benefit of this is so that files generated from build scripts can contain macros like cpp!. I'm also relying on cpp_synmap for embed_js, so this would be of use for the js! and include_js! macros as well.

ogoffart commented 5 years ago

That looks complicated to do as we need to parse so many environment variable.

I wonder if it would not be better to add api to cpp_build which would allow to add more files.

Note that cpp_synmap no longer exist in this repository.