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

Commit

Permalink
Automatically build Mediapipe native libraries during dotnet build (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Speykious authored Oct 17, 2021
1 parent 93d69c9 commit 4327c13
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<PropertyGroup Label="Pre-build task">
<PreBuildEvent>
if [ ! -f $(MSBuildProjectDirectory)/libmediapipe_c.so ]; then
cd $(MSBuildProjectDirectory)/../../../
python3 build.py build --desktop cpu -v
fi
</PreBuildEvent>
</PropertyGroup>

<ItemGroup>
<!-- I didn't think it would be this criminally simple to include the native library -->
<Content Include="*.so" Pack="true" PackagePath="lib\$(TargetFramework)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<PropertyGroup Label="Pre-build task">
<PreBuildEvent>
if not exist "$(MSBuildProjectDirectory)\libmediapipe_c.dll" (
cd $(MSBuildProjectDirectory)\..\..\..\
python3 build.py build --desktop cpu -v
)
</PreBuildEvent>
</PropertyGroup>

<ItemGroup>
<!-- I didn't think it would be this criminally simple to include the native library -->
<Content Include="*.dll" Pack="true" PackagePath="lib\$(TargetFramework)">
Expand Down

0 comments on commit 4327c13

Please sign in to comment.