-
Notifications
You must be signed in to change notification settings - Fork 643
Add Tizen x64 and arm64 native build support #3607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,14 +48,24 @@ | |
| <ItemGroup Condition="$(TargetFramework.Contains('-tizen'))"> | ||
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\i586\libSkiaSharp.so"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\linux-x86\native\</TizenTpkSubDir> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-x86\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> | ||
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\armel\libSkiaSharp.so"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-armel\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> | ||
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libSkiaSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libSkiaSharp.so')"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-x64\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> | ||
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libSkiaSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libSkiaSharp.so')"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-arm64\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> | ||
|
||
| </ItemGroup> | ||
|
|
||
| <ItemGroup Condition="$(TargetFramework.Contains('-tvos')) and '$(RuntimeIdentifier)' != ''"> | ||
|
|
||
| +9 −1 | gn/BUILDCONFIG.gn | |
| +1 −0 | include/c/sk_surface.h | |
| +4 −0 | src/c/sk_surface.cpp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,20 +9,31 @@ DirectoryPath TIZEN_STUDIO_HOME = EnvironmentVariable("TIZEN_STUDIO_HOME") ?? PR | |
|
|
||
| var bat = IsRunningOnWindows() ? ".bat" : ""; | ||
| var tizen = TIZEN_STUDIO_HOME.CombineWithFilePath($"tools/ide/bin/tizen{bat}").FullPath; | ||
| var tizenVersion = "6.0"; | ||
|
|
||
| void SetProjectProfile(string projectDir, string profile) | ||
| { | ||
| var propFile = MakeAbsolute((FilePath)$"{projectDir}/project_def.prop").FullPath; | ||
| var propContent = System.IO.File.ReadAllText(propFile); | ||
| propContent = System.Text.RegularExpressions.Regex.Replace( | ||
| propContent, @"^profile = .+$", $"profile = {profile}", | ||
| System.Text.RegularExpressions.RegexOptions.Multiline); | ||
| System.IO.File.WriteAllText(propFile, propContent); | ||
|
||
| } | ||
|
|
||
| Task("libSkiaSharp") | ||
| .IsDependentOn("git-sync-deps") | ||
| .Does(() => | ||
| { | ||
| Build("armel", "arm", $"mobile-{tizenVersion}-device.core"); | ||
| Build("i586", "x86", $"mobile-{tizenVersion}-emulator.core"); | ||
| Build("armel", "arm", "arm", "mobile-6.0-device.core", "mobile-6.0", "6.0"); | ||
| Build("i586", "x86", "x86", "mobile-6.0-emulator.core", "mobile-6.0", "6.0"); | ||
| Build("x86_64","x64", "x86_64", "tizen-8.0-emulator64.core", "tizen-8.0", "8.0"); | ||
| Build("aarch64","arm64","aarch64", "tizen-8.0-device64.core", "tizen-8.0", "8.0"); | ||
|
|
||
| void Build(string arch, string skiaArch, string rootstrap) | ||
| void Build(string outputDir, string skiaArch, string tizenArch, string rootstrap, string profile, string ncliVersion) | ||
| { | ||
| if (Skip(arch)) return; | ||
| if (Skip(outputDir)) return; | ||
|
|
||
| GnNinja($"tizen/{arch}", "skia modules/skottie", | ||
| GnNinja($"tizen/{outputDir}", "skia modules/skottie", | ||
| $"target_os='tizen' " + | ||
| $"target_cpu='{skiaArch}' " + | ||
| $"skia_enable_ganesh=true " + | ||
|
|
@@ -39,14 +50,20 @@ Task("libSkiaSharp") | |
| $"skia_enable_skottie=true " + | ||
| $"extra_cflags=[ '-DSKIA_C_DLL', '-DXML_DEV_URANDOM' ] " + | ||
| $"ncli='{TIZEN_STUDIO_HOME}' " + | ||
| $"ncli_version='{tizenVersion}'"); | ||
| $"ncli_version='{ncliVersion}'"); | ||
|
|
||
| SetProjectProfile("libSkiaSharp", profile); | ||
|
|
||
| var buildDir = MakeAbsolute((DirectoryPath)$"libSkiaSharp/{CONFIGURATION}"); | ||
| if (DirectoryExists(buildDir)) | ||
| DeleteDirectory(buildDir, new DeleteDirectorySettings { Recursive = true, Force = true }); | ||
|
|
||
| RunProcess(tizen, new ProcessSettings { | ||
| Arguments = $"build-native -a {skiaArch} -c llvm -C {CONFIGURATION} -r {rootstrap}" , | ||
| Arguments = $"build-native -a {tizenArch} -c llvm -C {CONFIGURATION} -r {rootstrap}", | ||
| WorkingDirectory = MakeAbsolute((DirectoryPath)"libSkiaSharp").FullPath, | ||
| }); | ||
|
|
||
| var outDir = OUTPUT_PATH.Combine(arch); | ||
| var outDir = OUTPUT_PATH.Combine(outputDir); | ||
| EnsureDirectoryExists(outDir); | ||
| CopyFile($"libSkiaSharp/{CONFIGURATION}/libskiasharp.so", outDir.CombineWithFilePath("libSkiaSharp.so")); | ||
| } | ||
|
|
@@ -55,19 +72,27 @@ Task("libSkiaSharp") | |
| Task("libHarfBuzzSharp") | ||
| .Does(() => | ||
| { | ||
| Build("armel", "arm", $"mobile-{tizenVersion}-device.core"); | ||
| Build("i586", "x86", $"mobile-{tizenVersion}-emulator.core"); | ||
| Build("armel", "arm", "mobile-6.0-device.core", "mobile-6.0"); | ||
| Build("i586", "x86", "mobile-6.0-emulator.core", "mobile-6.0"); | ||
| Build("x86_64","x86_64", "tizen-8.0-emulator64.core", "tizen-8.0"); | ||
| Build("aarch64","aarch64","tizen-8.0-device64.core", "tizen-8.0"); | ||
|
|
||
| void Build(string arch, string cliArch, string rootstrap) | ||
| void Build(string outputDir, string tizenArch, string rootstrap, string profile) | ||
| { | ||
| if (Skip(arch)) return; | ||
| if (Skip(outputDir)) return; | ||
|
|
||
| SetProjectProfile("libHarfBuzzSharp", profile); | ||
|
|
||
| var buildDir = MakeAbsolute((DirectoryPath)$"libHarfBuzzSharp/{CONFIGURATION}"); | ||
| if (DirectoryExists(buildDir)) | ||
| DeleteDirectory(buildDir, new DeleteDirectorySettings { Recursive = true, Force = true }); | ||
|
|
||
| RunProcess(tizen, new ProcessSettings { | ||
| Arguments = $"build-native -a {cliArch} -c llvm -C {CONFIGURATION} -r {rootstrap}" , | ||
| Arguments = $"build-native -a {tizenArch} -c llvm -C {CONFIGURATION} -r {rootstrap}", | ||
| WorkingDirectory = MakeAbsolute((DirectoryPath)"libHarfBuzzSharp").FullPath, | ||
| }); | ||
|
|
||
| var outDir = OUTPUT_PATH.Combine(arch); | ||
| var outDir = OUTPUT_PATH.Combine(outputDir); | ||
| EnsureDirectoryExists(outDir); | ||
| CopyFile($"libHarfBuzzSharp/{CONFIGURATION}/libharfbuzzsharp.so", outDir.CombineWithFilePath("libHarfBuzzSharp.so")); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| # - https://developercommunity.visualstudio.com/content/problem/661596/the-updated-path-doesnt-kick-in.html | ||
|
|
||
| Param( | ||
| [string] $Version = "5.6", | ||
| [string] $Version = "6.1", | ||
| [string] $InstallDestination = $null, | ||
| [boolean] $UpgradeLLVM = $true | ||
| ) | ||
|
|
@@ -33,7 +33,7 @@ Write-Host "Install destination is '$ts'..." | |
|
|
||
| $tsTemp = Join-Path "$HOME_DIR" "tizen-temp" | ||
| $install = Join-Path "$tsTemp" "tizen-install.$ext" | ||
| $packages = "MOBILE-6.0-NativeAppDevelopment" | ||
| $packages = "MOBILE-6.0-NativeAppDevelopment,TIZEN-8.0-NativeAppDevelopment" | ||
|
|
||
| # download | ||
| Write-Host "Downloading SDK to '$install'..." | ||
|
|
@@ -46,6 +46,12 @@ Write-Host "JAVA_HOME is: $env:JAVA_HOME" | |
| Write-Host "PATH contains JAVA_HOME: $($env:PATH.Contains("$env:JAVA_HOME"))" | ||
| & "java" -version | ||
|
|
||
| # clean up any previous install (the 6.1 installer fails if the directory already exists) | ||
| if (Test-Path "$ts") { | ||
| Write-Host "Removing previous installation at '$ts'..." | ||
| Remove-Item -Path "$ts" -Recurse -Force | ||
| } | ||
|
||
|
|
||
| # install | ||
| Write-Host "Installing SDK to '$ts'..." | ||
| if ($IsMacOS -or $IsLinux) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
tizen-x64/tizen-arm64entries are gated onExists(...), so a Tizen app build can succeed while silently omitting the required native library for those architectures (leading to runtime load failures). Prefer conditioning these items on the active$(RuntimeIdentifier)(e.g., includex86_64only fortizen-x64,aarch64only fortizen-arm64) and/or failing the build if the expected file is missing, rather than skipping the item entirely.