Skip to content

Commit

Permalink
add a build time error
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmd-azeez committed Nov 20, 2024
1 parent 5c9eabb commit fe35005
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/Extism.Pdk/Extism.Pdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<SupportedVersions>net8.0</SupportedVersions>
<RootNamespace>Extism.Pdk</RootNamespace>
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
<OutputType>Library</OutputType>
Expand Down
5 changes: 5 additions & 0 deletions src/Extism.Pdk/build/Extism.Pdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
<EventSourceSupport>false</EventSourceSupport>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<NativeDebugSymbols>false</NativeDebugSymbols>
<UseAppHost>false</UseAppHost>
</PropertyGroup>

<Target Name="EnforceDotNet8" BeforeTargets="Build">
<Error Condition="'$(TargetFramework)' != 'net8.0'" Text="Extism PDK can only be used in projects targeting .NET 8. See https://github.com/extism/dotnet-pdk/issues/110" />
</Target>

<UsingTask TaskName="GenerateFFITask" AssemblyFile="$(MSBuildThisFileDirectory)..\build\Extism.Pdk.MSBuild.dll" Condition="'$(RuntimeIdentifier)' == 'wasi-wasm'"/>
<Target Name="GenerateGlueCode" AfterTargets="Build" BeforeTargets="_BeforeWasmBuildApp" Condition="'$(RuntimeIdentifier)' == 'wasi-wasm'">
<GenerateFFITask AssemblyPath="$(TargetPath)" OutputPath="$(IntermediateOutputPath)extism" ExtismPath="$(MSBuildThisFileDirectory)..\native\extism.c" />
Expand Down

0 comments on commit fe35005

Please sign in to comment.