<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>

  <PropertyGroup Label="Globals">
    <ProjectGuid>{C1D2E3F4-A5B6-4789-BCDE-700000000007}</ProjectGuid>
    <RootNamespace>Darra_Rust_SDK</RootNamespace>
    <ProjectName>Darra.SDK.Rust</ProjectName>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
  </PropertyGroup>

  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ConfigurationType>Makefile</ConfigurationType>
  </PropertyGroup>
  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ConfigurationType>Makefile</ConfigurationType>
  </PropertyGroup>

  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings" />
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
  </ImportGroup>

  <PropertyGroup Label="UserMacros" />

  <!-- Debug 构建命令 (Cargo + 版本自动递增) -->
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <NMakeBuildCommandLine>cd /d "$(ProjectDir)" &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\version_increment.ps1" "$(SolutionDir)version\sdk_rust.txt" "Debug" &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\sync_version.ps1" "$(SolutionDir)version\sdk_rust.txt" "cargo" "$(ProjectDir)Cargo.toml" &amp;&amp; cargo build</NMakeBuildCommandLine>
    <NMakeCleanCommandLine>cd /d "$(ProjectDir)" &amp;&amp; cargo clean</NMakeCleanCommandLine>
    <NMakeReBuildCommandLine>cd /d "$(ProjectDir)" &amp;&amp; cargo clean &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\version_increment.ps1" "$(SolutionDir)version\sdk_rust.txt" "Debug" &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\sync_version.ps1" "$(SolutionDir)version\sdk_rust.txt" "cargo" "$(ProjectDir)Cargo.toml" &amp;&amp; cargo build</NMakeReBuildCommandLine>
    <NMakeOutput>$(ProjectDir)target\debug\ethercat.dll</NMakeOutput>
  </PropertyGroup>

  <!-- Release 构建命令 (Cargo + 版本自动递增) -->
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <NMakeBuildCommandLine>cd /d "$(ProjectDir)" &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\version_increment.ps1" "$(SolutionDir)version\sdk_rust.txt" "Release" &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\sync_version.ps1" "$(SolutionDir)version\sdk_rust.txt" "cargo" "$(ProjectDir)Cargo.toml" &amp;&amp; cargo build --release</NMakeBuildCommandLine>
    <NMakeCleanCommandLine>cd /d "$(ProjectDir)" &amp;&amp; cargo clean</NMakeCleanCommandLine>
    <NMakeReBuildCommandLine>cd /d "$(ProjectDir)" &amp;&amp; cargo clean &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\version_increment.ps1" "$(SolutionDir)version\sdk_rust.txt" "Release" &amp;&amp; powershell -NoProfile -File "$(SolutionDir)cmake\sync_version.ps1" "$(SolutionDir)version\sdk_rust.txt" "cargo" "$(ProjectDir)Cargo.toml" &amp;&amp; cargo build --release</NMakeReBuildCommandLine>
    <NMakeOutput>$(ProjectDir)target\release\ethercat.dll</NMakeOutput>
  </PropertyGroup>

  <!-- ===================== Rust 源文件 ===================== -->
  <ItemGroup>
    <!-- 库入口 -->
    <None Include="src\lib.rs" />
    <!-- Master -->
    <None Include="src\master\mod.rs" />
    <None Include="src\master\config.rs" />
    <None Include="src\master\core.rs" />
    <None Include="src\master\diagnostics.rs" />
    <None Include="src\master\events.rs" />
    <None Include="src\master\mailbox_gateway.rs" />
    <None Include="src\master\master_od.rs" />
    <None Include="src\master\other.rs" />
    <None Include="src\master\redundancy.rs" />
    <None Include="src\master\state.rs" />
    <!-- Slave -->
    <None Include="src\slave\mod.rs" />
    <None Include="src\slave\aoe.rs" />
    <None Include="src\slave\cia401.rs" />
    <None Include="src\slave\cia402.rs" />
    <None Include="src\slave\coe.rs" />
    <None Include="src\slave\dc.rs" />
    <None Include="src\slave\eoe.rs" />
    <None Include="src\slave\foe.rs" />
    <None Include="src\slave\fsoe.rs" />
    <None Include="src\slave\mdp.rs" />
    <None Include="src\slave\pdo.rs" />
    <None Include="src\slave\soe.rs" />
    <None Include="src\slave\startup.rs" />
    <None Include="src\slave\topology.rs" />
    <None Include="src\slave\voe.rs" />
    <!-- Data -->
    <None Include="src\data\mod.rs" />
    <None Include="src\data\error.rs" />
    <None Include="src\data\structures.rs" />
    <None Include="src\data\types.rs" />
    <!-- Logging -->
    <None Include="src\logging\mod.rs" />
    <None Include="src\logging\logging.rs" />
    <!-- Statics -->
    <None Include="src\statics\mod.rs" />
    <None Include="src\statics\authorization.rs" />
    <None Include="src\statics\device_info.rs" />
    <None Include="src\statics\network.rs" />
    <None Include="src\statics\other.rs" />
    <None Include="src\statics\print.rs" />
    <None Include="src\statics\version_info.rs" />
    <!-- Utils -->
    <None Include="src\utils\mod.rs" />
    <None Include="src\utils\base_data.rs" />
    <None Include="src\utils\esi.rs" />
    <None Include="src\utils\ffi.rs" />
    <None Include="src\utils\help.rs" />
    <None Include="src\utils\protection.rs" />
    <None Include="src\utils\startup_verifier.rs" />
    <None Include="src\utils\version_info.rs" />
    <None Include="src\utils\xml.rs" />
    <!-- 示例 -->
    <None Include="examples\basic.rs" />
  </ItemGroup>

  <!-- ===================== 构建文件 ===================== -->
  <ItemGroup>
    <None Include="Cargo.toml" />
    <None Include="build.rs" />
  </ItemGroup>

  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets" />
</Project>
