Skip to content

Commit

Permalink
Tackling the mobile targets
Browse files Browse the repository at this point in the history
Source builds fine, but when testing with Android Simulator I'm getting an early crash inside of SDL/Silk. Getting same crach when running the Silk example itself. So probably unrelated.
  • Loading branch information
azeno committed May 13, 2022
1 parent 0b98e05 commit e443d1e
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 47 deletions.
File renamed without changes.
File renamed without changes.
24 changes: 1 addition & 23 deletions sources/core/Stride.Core/build/Stride.Core.targets
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,9 @@
<Type>$([System.Text.RegularExpressions.Regex]::Match('%(Identity)', `(.*);(.*);(.*)`).get_Groups().get_Item(1).ToString())</Type>
<SourcePath>$([System.Text.RegularExpressions.Regex]::Match('%(Identity)', `(.*);(.*);(.*)`).get_Groups().get_Item(2).ToString())</SourcePath>
<Link>$([System.Text.RegularExpressions.Regex]::Match('%(Identity)', `(.*);(.*);(.*)`).get_Groups().get_Item(3).ToString())</Link>
<HandledByPackage>false</HandledByPackage>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</_StrideDependencyLocal>
<_StrideDependencyNativeLib Include="@(_StrideDependencyLocal->'$(_StrideSourceDir)%(SourcePath)')" Condition="'%(_StrideDependencyLocal.Type)' == 'NativeLib'"/>
<!-- Mark runtimes/ as handled (NuGet will take care of copying it to output folder) -->
<!-- We can get rid of this once all native dependencies are handled through runtimes/ feature (mobile targets haven't been updated yet) -->
<_StrideDependencyNativeLib Update="@(_StrideDependencyNativeLib)" Condition="$([System.String]::new('%(_StrideDependencyNativeLib.Link)').StartsWith('runtimes\'))" >
<HandledByPackage>true</HandledByPackage>
</_StrideDependencyNativeLib>
</ItemGroup>

<!-- Message -->
Expand All @@ -180,23 +174,7 @@
<_StrideDependencyLocal Remove="@(_StrideDependencyLocal)"/>
</ItemGroup>
</Target>

<!-- Copy native libraries to output -->
<Target Name="_StrideSetupNativeLibrariesWindows" DependsOnTargets="_StrideBuildDependencies" AfterTargets="ResolveAssemblyReferences" Condition="('$(StridePlatform)' == 'Windows' Or '$(StridePlatform)' == 'macOS' Or '$(StridePlatform)' == 'Linux') And '$(CopyLocalLockFileAssemblies)' != 'false'">
<ItemGroup>
<None Include="@(_StrideDependencyNativeLib)" Condition=" '%(_StrideDependencyNativeLib.HandledByPackage)' == 'false' ">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Target>
<!-- When publishing, copy native libraries (only needed if CopyLocalLockFileAssemblies is set to false since _StrideSetupNativeLibrariesWindows won't run) -->
<Target Name="_StrideSetupNativeLibrariesDotNetPublish" DependsOnTargets="_StrideBuildDependencies" AfterTargets="ComputeFilesToPublish" Condition="'$(UsingMicrosoftNETSdk)' == 'true' And '$(CopyLocalLockFileAssemblies)' == 'false'">
<ItemGroup>
<ResolvedFileToPublish Include="@(_StrideDependencyNativeLib)" Condition=" '%(_StrideDependencyNativeLib.HandledByPackage)' == 'false' ">
<RelativePath>%(_StrideDependencyNativeLib.Link)</RelativePath>
</ResolvedFileToPublish>
</ItemGroup>
</Target>

<Target Name="_StrideSetupNativeLibrariesUWP" DependsOnTargets="_StrideBuildDependencies" AfterTargets="ResolveAssemblyReferences" Condition="'$(StridePlatform)' == 'UWP'">
<PropertyGroup>
<StrideCPU Condition="'$(Platform)' == 'x86'">x86</StrideCPU>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

<!-- Force msbuild to check to rebuild this assembly instead of letting VS IDE guess -->
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>

<!-- Use AssemblyName rather than RootNamespace for Resource class otherwise it might clash between some assemblies (i.e. MyGame and MyGame.Android) -->
<AndroidResgenNamespace>$(AssemblyName)</AndroidResgenNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<#@ template="" inherits="ProjectTemplateTransformation" language="C#" #>
<resources>
<string name="app_name"><#= Properties.PackageGameDisplayName #></string>
</resources>
44 changes: 21 additions & 23 deletions sources/native/Stride.Native.targets

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
</Target>
<Target Name="_StrideRegisterPackageFiles" Condition="'$(TargetFramework)' != ''" DependsOnTargets="_StrideGenerateDependenciesCore">
<ItemGroup Condition="'@(_StrideDependencyToCopy)' != ''">
<!-- Native dependencies usually go to the runtimes/RID/native folder -->
<!-- Native dependencies go to the runtimes/RID/native folder -->
<TfmSpecificPackageFile Include="@(_StrideDependencyToCopy)"
Condition=" '%(_StrideDependencyToCopy.Type)' == 'NativeLib' "
PackagePath="%(_StrideDependencyToCopy.TargetPath)" />
Expand Down
2 changes: 2 additions & 0 deletions sources/targets/Stride.Core.props
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@
<DesignTimeBuild Condition="'$(DesignTimeBuild)' == ''">False</DesignTimeBuild>
<!-- Use AssemblyName rather than RootNamespace for Resource class otherwise it might clash between some assemblies (i.e. Stride and Stride.Engine) -->
<AndroidResgenNamespace>$(AssemblyName)</AndroidResgenNamespace>
<!-- Needs to be set to 21 as long as generated entry point projects are - otherwise user gets a lot of build warnings -->
<SupportedOSPlatformVersion>21</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == '$(StrideFrameworkAndroid)' And '$(OutputType)' == 'Exe' ">
<AndroidApplication>true</AndroidApplication>
Expand Down

0 comments on commit e443d1e

Please sign in to comment.