Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 4327c13

Browse files
authored
Automatically build Mediapipe native libraries during dotnet build (#58)
* Added PreBuildEvent to Linux runtime project * Added PreBuildEvent to Windows runtime project * Fix dumb Powershell error * Remove quotes * Test PowerShell before building * Fix path * Putting expression in quotes to see what happens * Only test on Windows * Temporarily not building on Windows * Remove Test Powershell on CI * Bring back quotesand print PSVersionTable * Use Batch syntax instead of Powershell syntax * Uncomment Windows .NET Build task on CI
1 parent 93d69c9 commit 4327c13

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Runtime/Akihabara.Runtime.Linux_x64.CPU/Akihabara.Runtime.Linux_x64.CPU.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
<IncludeBuildOutput>false</IncludeBuildOutput>
2222
</PropertyGroup>
2323

24+
<PropertyGroup Label="Pre-build task">
25+
<PreBuildEvent>
26+
if [ ! -f $(MSBuildProjectDirectory)/libmediapipe_c.so ]; then
27+
cd $(MSBuildProjectDirectory)/../../../
28+
python3 build.py build --desktop cpu -v
29+
fi
30+
</PreBuildEvent>
31+
</PropertyGroup>
32+
2433
<ItemGroup>
2534
<!-- I didn't think it would be this criminally simple to include the native library -->
2635
<Content Include="*.so" Pack="true" PackagePath="lib\$(TargetFramework)">

src/Runtime/Akihabara.Runtime.Windows_x64.CPU/Akihabara.Runtime.Windows_x64.CPU.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
<IncludeBuildOutput>false</IncludeBuildOutput>
2222
</PropertyGroup>
2323

24+
<PropertyGroup Label="Pre-build task">
25+
<PreBuildEvent>
26+
if not exist "$(MSBuildProjectDirectory)\libmediapipe_c.dll" (
27+
cd $(MSBuildProjectDirectory)\..\..\..\
28+
python3 build.py build --desktop cpu -v
29+
)
30+
</PreBuildEvent>
31+
</PropertyGroup>
32+
2433
<ItemGroup>
2534
<!-- I didn't think it would be this criminally simple to include the native library -->
2635
<Content Include="*.dll" Pack="true" PackagePath="lib\$(TargetFramework)">

0 commit comments

Comments
 (0)