Skip to content

Commit de0cec3

Browse files
committed
split native
1 parent 0b04026 commit de0cec3

File tree

9 files changed

+57
-32
lines changed

9 files changed

+57
-32
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
- uses: actions/upload-artifact@v4
3939
with:
4040
name: 'managed'
41-
path: ./Coplt.Graphics/bin/Release/net9.0/
41+
path: ./Coplt.Graphics.Core/bin/Release/*.nupkg
4242
overwrite: true
4343
- uses: actions/upload-artifact@v4
4444
with:
45-
name: 'native-windows-x64-debug'
46-
path: ./build/debug/bin/
45+
name: 'native-d3d12-debug'
46+
path: ./Coplt.Graphics.Native.D3d12/bin/Debug/*.nupkg
4747
overwrite: true
4848
- uses: actions/upload-artifact@v4
4949
with:
50-
name: 'native-windows-x64-release'
51-
path: ./build/release/bin/
50+
name: 'native-d3d12-release'
51+
path: ./Coplt.Graphics.Native.D3d12/bin/Release/*.nupkg
5252
overwrite: true

Coplt.Graphics.Core/Coplt.Graphics.Core.csproj

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<NoWarn>CS8500</NoWarn>
99
<IsAotCompatible>true</IsAotCompatible>
1010
<RootNamespace>Coplt.Graphics</RootNamespace>
11+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
@@ -32,22 +33,4 @@
3233
<Exec Command="ClangSharpPInvokeGenerator -std=c++23 @GenerateBinding.D3d12.rsp"/>
3334
</Target>
3435

35-
<Target Name="NativeBuildDebug" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">
36-
<Exec Command="cmake --build --target Coplt_Graphics_Native_D3d12 --preset debug" WorkingDirectory=".."/>
37-
<ItemGroup>
38-
<NativeOutputs Include="../build/debug/bin/**/*.dll" Visible="false" CopyToOutputDirectory="PreserveNewest"/>
39-
<NativeOutputs Include="../build/debug/bin/**/*.pdb" Visible="false" CopyToOutputDirectory="PreserveNewest"/>
40-
<!-- <NativeOutputs Include="../build/debug/WinPixEventRuntime/bin/x64/WinPixEventRuntime.dll" Visible="false"/>-->
41-
</ItemGroup>
42-
<Copy SourceFiles="@(NativeOutputs)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true"/>
43-
</Target>
44-
<Target Name="NativeBuildRelease" AfterTargets="Build" Condition="'$(Configuration)' != 'Debug'">
45-
<Exec Command="cmake --build --target Coplt_Graphics_Native_D3d12 --preset release" WorkingDirectory=".."/>
46-
<ItemGroup>
47-
<NativeOutputs Include="../build/release/bin/**/*.dll" Visible="false" CopyToOutputDirectory="PreserveNewest"/>
48-
<!-- <NativeOutputs Include="../build/release/WinPixEventRuntime/bin/x64/WinPixEventRuntime.dll" Visible="false"/>-->
49-
</ItemGroup>
50-
<Copy SourceFiles="@(NativeOutputs)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true"/>
51-
</Target>
52-
5336
</Project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
9+
<IncludeBuildOutput>false</IncludeBuildOutput>
10+
<NoWarn>NU5128</NoWarn>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\Coplt.Graphics.Core\Coplt.Graphics.Core.csproj" />
15+
</ItemGroup>
16+
17+
<Target Name="NativeBuildDebug" BeforeTargets="Build" Condition="'$(Configuration)' == 'Debug'" Outputs="../build/debug/bin/**/*">
18+
<Exec Command="cmake --build --target Coplt_Graphics_Native_D3d12 --preset debug" WorkingDirectory=".."/>
19+
<ItemGroup>
20+
<NativeOutputs Include="../build/debug/bin/**/*.dll"/>
21+
<NativeOutputs Include="../build/debug/bin/**/*.pdb"/>
22+
<None Include="@(NativeOutputs)" Pack="true" PackagePath="runtimes\win-x64\native\"/>
23+
</ItemGroup>
24+
<Copy SourceFiles="@(NativeOutputs)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true"/>
25+
</Target>
26+
<Target Name="NativeBuildRelease" BeforeTargets="Build" Condition="'$(Configuration)' != 'Debug'" Outputs="../build/release/bin/**/*">
27+
<Exec Command="cmake --build --target Coplt_Graphics_Native_D3d12 --preset release" WorkingDirectory=".."/>
28+
<ItemGroup>
29+
<NativeOutputs Include="../build/release/bin/**/*.dll"/>
30+
<None Include="@(NativeOutputs)" Pack="true" PackagePath="runtimes\win-x64\native\"/>
31+
</ItemGroup>
32+
<Copy SourceFiles="@(NativeOutputs)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" UseHardlinksIfPossible="true"/>
33+
</Target>
34+
35+
</Project>

Coplt.Graphics.sln

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloTriangle", "Examples\H
88
EndProject
99
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloCube", "Examples\HelloCube\HelloCube.csproj", "{B52949D2-5811-4DBB-B25E-927DFB16F863}"
1010
EndProject
11-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleBase", "ExampleBase\ExampleBase.csproj", "{648436F1-B4EC-4491-B4B2-2B7EA8F964F3}"
11+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Coplt.Graphics.Native.D3d12", "Coplt.Graphics.Native.D3d12\Coplt.Graphics.Native.D3d12.csproj", "{9B2BF8A4-3978-4639-B8D8-20C75138CDC9}"
12+
EndProject
13+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleBase", "Examples\ExampleBase\ExampleBase.csproj", "{B4F50522-B216-413B-AEC5-ED6D9114D1EE}"
1214
EndProject
1315
Global
1416
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -28,14 +30,18 @@ Global
2830
{B52949D2-5811-4DBB-B25E-927DFB16F863}.Debug|Any CPU.Build.0 = Debug|Any CPU
2931
{B52949D2-5811-4DBB-B25E-927DFB16F863}.Release|Any CPU.ActiveCfg = Release|Any CPU
3032
{B52949D2-5811-4DBB-B25E-927DFB16F863}.Release|Any CPU.Build.0 = Release|Any CPU
31-
{648436F1-B4EC-4491-B4B2-2B7EA8F964F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32-
{648436F1-B4EC-4491-B4B2-2B7EA8F964F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
33-
{648436F1-B4EC-4491-B4B2-2B7EA8F964F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
34-
{648436F1-B4EC-4491-B4B2-2B7EA8F964F3}.Release|Any CPU.Build.0 = Release|Any CPU
33+
{9B2BF8A4-3978-4639-B8D8-20C75138CDC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{9B2BF8A4-3978-4639-B8D8-20C75138CDC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{9B2BF8A4-3978-4639-B8D8-20C75138CDC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
36+
{9B2BF8A4-3978-4639-B8D8-20C75138CDC9}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{B4F50522-B216-413B-AEC5-ED6D9114D1EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{B4F50522-B216-413B-AEC5-ED6D9114D1EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{B4F50522-B216-413B-AEC5-ED6D9114D1EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{B4F50522-B216-413B-AEC5-ED6D9114D1EE}.Release|Any CPU.Build.0 = Release|Any CPU
3541
EndGlobalSection
3642
GlobalSection(NestedProjects) = preSolution
3743
{2ABF3CFF-8E44-4992-A633-491B2AAA5BFB} = {DBD91642-35A7-4287-9856-CA8E09605928}
3844
{B52949D2-5811-4DBB-B25E-927DFB16F863} = {DBD91642-35A7-4287-9856-CA8E09605928}
39-
{648436F1-B4EC-4491-B4B2-2B7EA8F964F3} = {DBD91642-35A7-4287-9856-CA8E09605928}
45+
{B4F50522-B216-413B-AEC5-ED6D9114D1EE} = {DBD91642-35A7-4287-9856-CA8E09605928}
4046
EndGlobalSection
4147
EndGlobal
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<ProjectReference Include="..\Coplt.Graphics.Core\Coplt.Graphics.Core.csproj" />
10+
<ProjectReference Include="..\..\Coplt.Graphics.Core\Coplt.Graphics.Core.csproj" />
11+
<ProjectReference Include="..\..\Coplt.Graphics.Native.D3d12\Coplt.Graphics.Native.D3d12.csproj" ReferenceOutputAssembly="false" />
1112
<PackageReference Include="Serilog" Version="4.2.0"/>
1213
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0"/>
1314
<PackageReference Include="Serilog.Exceptions" Version="8.4.0"/>

Examples/HelloCube/HelloCube.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<ItemGroup>
1818
<ProjectReference Include="..\..\Coplt.Graphics.Core\Coplt.Graphics.Core.csproj" />
19-
<ProjectReference Include="..\..\ExampleBase\ExampleBase.csproj" />
19+
<ProjectReference Include="..\ExampleBase\ExampleBase.csproj" />
2020
<PackageReference Include="Serilog" Version="4.2.0"/>
2121
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0"/>
2222
<PackageReference Include="Serilog.Exceptions" Version="8.4.0"/>

Examples/HelloTriangle/HelloTriangle.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<ItemGroup>
1818
<ProjectReference Include="..\..\Coplt.Graphics.Core\Coplt.Graphics.Core.csproj" />
19-
<ProjectReference Include="..\..\ExampleBase\ExampleBase.csproj" />
19+
<ProjectReference Include="..\ExampleBase\ExampleBase.csproj" />
2020
<PackageReference Include="Serilog" Version="4.2.0"/>
2121
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0"/>
2222
<PackageReference Include="Serilog.Exceptions" Version="8.4.0"/>

0 commit comments

Comments
 (0)