Skip to content

ifdefs or equivalent #35718

Closed as not planned
Closed as not planned
@Hixie

Description

@Hixie

I'd like to be able to check, at compile time, whether an environment variable is set, and if so, I'd like to declare a particular identifier as a constant whose value is derived from that environment variable, and if not, I'd like it to be a mutable variable.

Specifically, I'd like defaultTargetPlatform to be const in release builds so that we can tree-shake code that depends on it (and not include iOS logic in Android apps), while in debug builds it remains a variable whose value we can dynamically change via the service protocol extension we have today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).closed-staleClosed as the issue or PR is assumed staletype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions