Skip to content

Commit 7650b9a

Browse files
committed
Change the iOS build to create a full, combined libveldrid-spirv-static.a and include it in nupkg.
1 parent adf8471 commit 7650b9a

File tree

5 files changed

+11
-25
lines changed

5 files changed

+11
-25
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ set_target_properties(veldrid-spirv PROPERTIES PREFIX "lib")
3838
set_target_properties(veldrid-spirv PROPERTIES DEBUG_POSTFIX "")
3939

4040
set_target_properties(veldrid-spirv PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
41+
42+
shaderc_combine_static_lib(veldrid-spirv-combined veldrid-spirv)

build-full-package.ps1

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,15 @@ if( -not $? )
7676
Write-Host "- libveldrid-spirv.dylib (64-bit macOS)"
7777

7878
$client.DownloadFile(
79-
"https://github.com/mellinoe/veldrid-spirv/releases/download/$tag/libveldrid-spirv.a",
80-
"$PSScriptRoot/download/$configuration/ios/libveldrid-spirv.a")
79+
"https://github.com/mellinoe/veldrid-spirv/releases/download/$tag/libveldrid-spirv-combined.a",
80+
"$PSScriptRoot/download/$configuration/ios/libveldrid-spirv-combined.a")
8181
if( -not $? )
8282
{
8383
$msg = $Error[0].Exception.Message
84-
Write-Error "Couldn't download libveldrid-spirv.a. This most likely indicates the iOS native build failed."
84+
Write-Error "Couldn't download libveldrid-spirv-combined.a. This most likely indicates the iOS native build failed."
8585
exit
8686
}
87-
Write-Host "- libveldrid-spirv.a (64-bit iOS)"
88-
89-
$client.DownloadFile(
90-
"https://github.com/mellinoe/veldrid-spirv/releases/download/$tag/libshaderc_combined.a",
91-
"$PSScriptRoot/download/$configuration/ios/libshaderc_combined.a")
92-
if( -not $? )
93-
{
94-
$msg = $Error[0].Exception.Message
95-
Write-Error "Couldn't download libshaderc_combined.a. This most likely indicates the iOS native build failed."
96-
exit
97-
}
98-
Write-Host "- libshaderc_combined.a (64-bit iOS)"
87+
Write-Host "- libveldrid-spirv-combined.a (64-bit iOS)"
9988

10089
$client.DownloadFile(
10190
"https://github.com/mellinoe/veldrid-spirv/releases/download/$tag/libveldrid-spirv.android-arm64-v8a.so",

build-native.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ _CMakeToolchain=
66
_CMakeIOSPlatform=
77
_CMakeEnableBitcode=
88
_OutputPathPrefix=
9+
_CMakeBuildTarget=veldrid-spirv
910

1011
while :; do
1112
if [ $# -le 0 ]; then
@@ -25,6 +26,7 @@ while :; do
2526
_CMakeIOSPlatform=-DIOS_PLATFORM=OS64
2627
_CMakeEnableBitcode=-DENABLE_BITCODE=0
2728
_OutputPathPrefix=ios-
29+
_CMakeBuildTarget=veldrid-spirv-combined_genfile
2830
;;
2931
*)
3032
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
@@ -43,5 +45,5 @@ fi
4345
mkdir -p $_OutputPath
4446
pushd $_OutputPath
4547
cmake ../.. -DCMAKE_BUILD_TYPE=$_CMakeBuildType $_CMakeToolchain $_CMakeIOSPlatform $_CMakeEnableBitcode -DPYTHON_EXE=$_PythonExePath
46-
make
48+
cmake --build . --target $_CMakeBuildTarget
4749
popd

src/Veldrid.SPIRV/Veldrid.SPIRV.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
<_NativeAssetName Include="$(Configuration)/win-x64/libveldrid-spirv.dll" PackagePath="runtimes/win-x64/native" />
3434
<_NativeAssetName Include="$(Configuration)/linux-x64/libveldrid-spirv.so" PackagePath="runtimes/linux-x64/native" />
3535
<_NativeAssetName Include="$(Configuration)/osx-x64/libveldrid-spirv.dylib" PackagePath="runtimes/osx-x64/native" />
36-
<_NativeAssetName Include="$(Configuration)/ios/libveldrid-spirv.a" PackagePath="build/Xamarin.iOS10/native" />
37-
<_NativeAssetName Include="$(Configuration)/ios/libshaderc_combined.a" PackagePath="build/Xamarin.iOS10/native" />
36+
<_NativeAssetName Include="$(Configuration)/ios/libveldrid-spirv-combined.a" PackagePath="build/Xamarin.iOS10/native" />
3837
<_NativeAssetName Include="$(Configuration)/android-arm64-v8a/libveldrid-spirv.so" PackagePath="build/MonoAndroid10/native/arm64-v8a" />
3938
<_NativeAssetName Include="$(Configuration)/android-armeabi-v7a/libveldrid-spirv.so" PackagePath="build/MonoAndroid10/native/armeabi-v7a" />
4039

src/Veldrid.SPIRV/build/Xamarin.iOS10/Veldrid.SPIRV.targets

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
4-
<NativeReference Include="$(MSBuildThisFileDirectory)native\libshaderc_combined.a">
5-
<Kind>Static</Kind>
6-
<SmartLink>False</SmartLink>
7-
<ForceLoad>True</ForceLoad>
8-
<IsCxx>True</IsCxx>
9-
</NativeReference>
10-
<NativeReference Include="$(MSBuildThisFileDirectory)native\libveldrid-spirv.a">
4+
<NativeReference Include="$(MSBuildThisFileDirectory)native\libveldrid-spirv-combined.a">
115
<Kind>Static</Kind>
126
<SmartLink>False</SmartLink>
137
<ForceLoad>True</ForceLoad>

0 commit comments

Comments
 (0)