PazeE 编译器(.NET 8/C# 实现),直接生成原生 x64/ARM64 机器码,无需 gcc/clang/nasm。 主要特性: - 词法/语法/语义分析、AST 生成、代码生成 - 目标平台:Windows (PE32+)、Linux (ELF64)、macOS (Mach-O 64)、Los4 - 架构:AMD64 与 ARM64 独立后端 - C 语法特性:匿名结构体/联合、位域、灵活数组成员、语句表达式+typeof - printf 颜色格式化、time.get.utc 时区支持 - GUI 支持:Windows (Win11 API)、Los4、Linux (X11)、macOS (ObjC) - Windows GUI 程序无控制台窗口(PE 子系统自动检测) - WiX Bundle 安装器(仅输出 .exe,MSI 作为中间产物内嵌)
53 行
2.5 KiB
XML
53 行
2.5 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<OutputType>Exe</OutputType>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<Nullable>enable</Nullable>
|
|
<NoWarn>CS8618;CS0219</NoWarn>
|
|
<AssemblyName>paze</AssemblyName>
|
|
<RootNamespace>PazeE.Compiler</RootNamespace>
|
|
<LangVersion>latest</LangVersion>
|
|
<InvariantGlobalization>true</InvariantGlobalization>
|
|
|
|
<!-- 版本通道:release | beta | alpha,可经 -p:BuildChannel=beta 覆盖 -->
|
|
<BuildChannel Condition="'$(BuildChannel)' == ''">release</BuildChannel>
|
|
<BuildChannel Condition="'$(BuildChannel)' != 'release' And '$(BuildChannel)' != 'beta' And '$(BuildChannel)' != 'alpha'">release</BuildChannel>
|
|
<VersionPrefix>0.1.0</VersionPrefix>
|
|
<Version Condition="'$(BuildChannel)' == 'release'">$(VersionPrefix)</Version>
|
|
<Version Condition="'$(BuildChannel)' != 'release'">$(VersionPrefix)-$(BuildChannel)</Version>
|
|
<FileVersion>0.1.0.0</FileVersion>
|
|
<AssemblyVersion>0.1.0.0</AssemblyVersion>
|
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
|
|
<!-- 多文件输出(非单文件)。编译中间产物 → bin\<channel>\;发布产物 → publish\<version>\bin\(与 src 同级) -->
|
|
<BaseOutputPath>bin</BaseOutputPath>
|
|
<OutputPath>$(BaseOutputPath)\$(BuildChannel)\</OutputPath>
|
|
<PublishDir>..\..\publish\$(Version)\bin\</PublishDir>
|
|
<PublishSingleFile>false</PublishSingleFile>
|
|
<EnableCompressionInSingleFile>false</EnableCompressionInSingleFile>
|
|
<!-- 自包含与否由 publish 时的 self-contained 开关决定;此处不强制 -->
|
|
</PropertyGroup>
|
|
|
|
<!-- 生成 BuildInfo.g.cs:暴露当前通道与版本号 -->
|
|
<Target Name="GenerateBuildInfo" BeforeTargets="BeforeCompile">
|
|
<PropertyGroup>
|
|
<BuildInfoFile>$(IntermediateOutputPath)BuildInfo.g.cs</BuildInfoFile>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<BuildInfoLines Include="namespace PazeE.Compiler%3B" />
|
|
<BuildInfoLines Include="internal static class BuildInfo" />
|
|
<BuildInfoLines Include="{" />
|
|
<BuildInfoLines Include=" public const string Channel = "$(BuildChannel)"%3B" />
|
|
<BuildInfoLines Include=" public const string Version = "$(Version)"%3B" />
|
|
<BuildInfoLines Include="}" />
|
|
</ItemGroup>
|
|
<WriteLinesToFile File="$(BuildInfoFile)" Lines="@(BuildInfoLines)" Overwrite="true" />
|
|
<ItemGroup>
|
|
<Compile Include="$(BuildInfoFile)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
</Project>
|