Skip to content
Permalink
Browse files

[Build] Android: Fix NDB platform versions

  • Loading branch information
xen2 committed Oct 15, 2019
1 parent 297d239 commit c5c2a6402fc480baf45f06225157c213bf7b927a
Showing with 15 additions and 15 deletions.
  1. +15 −15 sources/native/Xenko.Native.targets
@@ -203,33 +203,33 @@
<XenkoNativeAndroidNdkVersion>$([System.Text.RegularExpressions.Regex]::Match($(_XenkoNativeAndroidNdkSourceProperties), `Pkg\.Revision = (.*)`).Groups[1].Value)</XenkoNativeAndroidNdkVersion>
<XenkoNativeAndroidNdkVersionMinimum>19.0</XenkoNativeAndroidNdkVersionMinimum>

<!-- Try to guess Android SDK version from build parameters, otherwise fallback to 27 (8.1) -->
<XenkoNativeAndroidPlatformVersion Condition="'$(_AndroidApiLevel)' != ''">$(_AndroidApiLevel)</XenkoNativeAndroidPlatformVersion>
<XenkoNativeAndroidPlatformVersion Condition="'$(XenkoNativeAndroidPlatformVersion)' == ''">27</XenkoNativeAndroidPlatformVersion>
<!-- Android NDK version is equivalent to minSdkVersion; note: 64 bits exist only from platform version 21 -->
<XenkoNativeAndroidPlatformVersion32>16</XenkoNativeAndroidPlatformVersion32>
<XenkoNativeAndroidPlatformVersion64>21</XenkoNativeAndroidPlatformVersion64>
</PropertyGroup>

<Error Condition="'$(XenkoNativeAndroidNdkVersion)' == ''" Text="Could not figure out Android NDK version from $(AndroidNdkDirectory). There should be a source.properties file with Pkg.Revision properly set." />
<Error Condition="$([System.Version]::Parse('$(XenkoNativeAndroidNdkVersionMinimum)').CompareTo($([System.Version]::Parse('$(XenkoNativeAndroidNdkVersion)')))) >= 0" Text="The Android NDK version is too old. Found: $(XenkoNativeAndroidNdkVersion), Expected: $(XenkoNativeAndroidNdkVersionMinimum), Location: $(AndroidNdkDirectory)" />

<MakeDir Directories="$(XenkoNativeOutputPath)\armeabi-v7a"/>
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_armeabi-v7a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=armv7-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_armeabi-v7a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=armv7-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\armeabi-v7a\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_armeabi-v7a.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-9\arch-arm&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\armeabi-v7a\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\armeabi-v7a\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=armv7-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_armeabi-v7a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=armv7-linux-android$(XenkoNativeAndroidPlatformVersion32)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_armeabi-v7a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=armv7-linux-android$(XenkoNativeAndroidPlatformVersion32)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\armeabi-v7a\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_armeabi-v7a.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-9\arch-arm&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\armeabi-v7a\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\armeabi-v7a\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=armv7-linux-android$(XenkoNativeAndroidPlatformVersion32)" />

<MakeDir Directories="$(XenkoNativeOutputPath)\arm64-v8a"/>
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_arm64-v8a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=aarch64-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_arm64-v8a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=aarch64-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\arm64-v8a\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_arm64-v8a.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-21\arch-arm64&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\arm64-v8a\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\arm64-v8a\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=aarch64-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_arm64-v8a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=aarch64-linux-android$(XenkoNativeAndroidPlatformVersion64)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_arm64-v8a.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=aarch64-linux-android$(XenkoNativeAndroidPlatformVersion64)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\arm64-v8a\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_arm64-v8a.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-21\arch-arm64&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\arm64-v8a\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\arm64-v8a\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=aarch64-linux-android$(XenkoNativeAndroidPlatformVersion64)" />

<MakeDir Directories="$(XenkoNativeOutputPath)\x86"/>
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=i386-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=i386-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\x86\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_x86.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-9\arch-x86&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\x86\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\x86\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=i386-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=i386-linux-android$(XenkoNativeAndroidPlatformVersion32)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=i386-linux-android$(XenkoNativeAndroidPlatformVersion32)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\x86\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_x86.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-9\arch-x86&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\x86\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\x86\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=i386-linux-android$(XenkoNativeAndroidPlatformVersion32)" />

<MakeDir Directories="$(XenkoNativeOutputPath)\x86_64"/>
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86_64.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=x86_64-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86_64.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=x86_64-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\x86_64\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_x86_64.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-21\arch-x86_64&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\x86_64\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\x86_64\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=x86_64-linux-android$(XenkoNativeAndroidPlatformVersion)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' != '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86_64.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=x86_64-linux-android$(XenkoNativeAndroidPlatformVersion64)" />
<Exec Condition="'%(XenkoNativeCFile.Extension)' == '.cpp'" Command="&quot;$(XenkoDependenciesDir)\LLVM\clang.exe&quot; $(XenkoNativeClangCPP) $(XenkoNativeClang) -o &quot;$(OutputObjectPath)\%(XenkoNativeCFile.Filename)_x86_64.o&quot; -c &quot;%(XenkoNativeCFile.FullPath)&quot; -DANDROID -fPIC --target=x86_64-linux-android$(XenkoNativeAndroidPlatformVersion64)" />
<Exec Command="&quot;$(AndroidNdkDirectory)\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe&quot; $(XenkoNativeToolingDebug) -shared -o &quot;$(XenkoNativeOutputPath)\x86_64\$(XenkoNativeOutputName)$(XenkoNativeLibraryTargetExt)&quot; @(XenkoNativeCFile->'&quot;$(OutputObjectPath)\%(Filename)_x86_64.o&quot;', ' ') --sysroot=&quot;$(AndroidNdkDirectory)\platforms\android-21\arch-x86_64&quot; @(XenkoNativePathLibs2->'&quot;$(XenkoDependenciesDir)\NativePath\Android\x86_64\%(Filename).a&quot;', ' ') &quot;$(XenkoDependenciesDir)\NativePath\Android\x86_64\libNativePath.a&quot; $(XenkoNativeAndroidClang) --target=x86_64-linux-android$(XenkoNativeAndroidPlatformVersion64)" />

<!-- Workaround: forcing C# rebuild so that timestamp are up to date (ideally we should have separate input/output groups for C# and Native) -->
<Delete Files="@(IntermediateAssembly)"/>

0 comments on commit c5c2a64

Please sign in to comment.
You can’t perform that action at this time.