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
Looking at the defines section, I see I can convert cfgs to defines, but what I'd like to be able to do is just to mimic /// cbindgen:ignore depending on the cfg.
For example, in my lib.rs I have:
#[no_mangle]#[cfg(not(target_os="android"))]pubexternfnce_start(argc:c_int,argv:*const*constc_char) -> c_int{
game::setup_logger();debug!("Launched as library...");// This is to convert from C Main Args to Rust Main Argslet _argc:isize = argc.try_into().unwrap();let _argv:*const*constu8 = argv as*const*constu8;return game::launch(_argc, _argv).try_into().unwrap();}
The cfg, #[cfg(not(target_os="android"))], prevents it from being exported on Android because I have no idea what will happen when one tries to run the engine without passing the AndroidApp var that is passed in from GameActivity. I pass it to winit, starting from a separate function called android_main. This is used to load the engine as opposed to ce_start which is used for launching as a native library. The point is, I don't want ce_start to show up in my bindings when I compile for Android.
I give a copy of the bindings file for each platform I build and different functions are available depending on what the platform is.
The text was updated successfully, but these errors were encountered:
Looking at the defines section, I see I can convert cfgs to defines, but what I'd like to be able to do is just to mimic
/// cbindgen:ignore
depending on the cfg.For example, in my lib.rs I have:
The cfg,
#[cfg(not(target_os="android"))]
, prevents it from being exported on Android because I have no idea what will happen when one tries to run the engine without passing the AndroidApp var that is passed in from GameActivity. I pass it to winit, starting from a separate function calledandroid_main
. This is used to load the engine as opposed to ce_start which is used for launching as a native library. The point is, I don't want ce_start to show up in my bindings when I compile for Android.I give a copy of the bindings file for each platform I build and different functions are available depending on what the platform is.
The text was updated successfully, but these errors were encountered: