I'm trying to hide boilerplate from a project template for my framework.
src/main.rs
rialight::initialize!(|app| {
// application
});
build.rs
rialight::initialize_build!(|| {
// procedure
});
Basically I'm having trouble with build.rs. The compiler says OUT_DIR
isn't defined. IIRC I did it some other time and it worked. I'm using a workspace, so the binary crate is in that workspace too, for debugging purposes.
#[macro_export]
macro_rules! initialize_build {
($lambda_exp:expr) => {
fn main() {
::rialight::entry_point::_build_preprocess(env!("OUT_DIR"));
let user_ie: fn() -> () = $lambda_exp;
user_ie();
}
};
}
I tried passing OUT_DIR
from build.rs to that macro as well...
My debug command:
cargo run -p rialight_blank_experiment