Skip to content

add NATIVEAOT constant when publish aot #44459

Open
@WeihanLi

Description

@WeihanLi

Is your feature request related to a problem? Please describe.

When publish with AOT, add a constant NATIVEAOT so that we could do aot-specific operation likes

#if NATIVEAOT
// .. aot-only
#endif

Describe the solution you'd like

When PublishAot is true, define additional constant

<PropertyGroup>
   <DefineConstants Condition="'$(PublishAot)'=='true'">$(DefineConstants);NATIVEAOT</DefineConstants> 
</PropertyGroup>

Additional context

see comment:
dotnet/runtime#109005 (reply in thread)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-NativeAOTNative AOT compilationuntriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions