Skip to content

iOS support for #[bevy_main] #21602

@bitdriftr

Description

@bitdriftr

What problem does this solve or what need does it fill?

My current cross-platform no_std main function looks like :

#[cfg(target_os = "ios")]
extern crate std; // required for mobile_entry_point
#[cfg(target_os = "ios")]
use std::eprintln; // required for mobile_entry_point

#[cfg_attr(target_os = "ios", mobile_entry_point::mobile_entry_point)]
#[cfg_attr(not(target_os = "ios"), bevy_main)]
fn main() {
    // ...
}

What solution would you like?

I wish it looked like :

#[bevy_main]
fn main() {
    // ...
}

Additional context

I am not sure if it's possible to expand a macro to another macro but if it's the case then this can be improved easily by just adding an ios cfg directive to expand to #[mobile_entry_point]. Otherwise maybe it's not worth it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-FeatureA new feature, making something new possibleS-Needs-TriageThis issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions