Skip to content

Commit

Permalink
Merge pull request #1519 from Apprentice-Alchemist/feature/android-ap…
Browse files Browse the repository at this point in the history
…i-21

Upgrade to android API level 21.
  • Loading branch information
player-03 authored Mar 9, 2022
2 parents 3ba4c4c + b15dcb9 commit 8397294
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 1 addition & 3 deletions project/Build.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<xml>

<set name="PLATFORM" value="android-16" if="android" unless="HXCPP_ARM64 || HXCPP_X86_64" />
<set name="PLATFORM" value="android-21" if="android HXCPP_ARM64" />
<set name="PLATFORM" value="android-21" if="android HXCPP_X86_64" />
<set name="PLATFORM" value="android-21" if="android" />
<set name="HXCPP_CPP11" value="1" />

<include name="${HXCPP}/build-tool/BuildCommon.xml" />
Expand Down
16 changes: 5 additions & 11 deletions tools/platforms/AndroidPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class AndroidPlatform extends PlatformTarget

for (architecture in architectures)
{
var haxeParams = [hxml, "-D", "android", "-D", "PLATFORM=android-16"];
var cppParams = ["-Dandroid", "-DPLATFORM=android-16"];
var haxeParams = [hxml, "-D", "android", "-D", "PLATFORM=android-21"];
var cppParams = ["-Dandroid", "-DPLATFORM=android-21"];
var path = sourceSet + "/jniLibs/armeabi";
var suffix = ".so";

Expand All @@ -86,9 +86,6 @@ class AndroidPlatform extends PlatformTarget
}
else if (architecture == Architecture.ARM64)
{
haxeParams = [hxml, "-D", "android", "-D", "PLATFORM=android-21"];
cppParams = ["-Dandroid", "-DPLATFORM=android-21"];

haxeParams.push("-D");
haxeParams.push("HXCPP_ARM64");
cppParams.push("-DHXCPP_ARM64");
Expand All @@ -105,9 +102,6 @@ class AndroidPlatform extends PlatformTarget
}
else if (architecture == Architecture.X64)
{
haxeParams = [hxml, "-D", "android", "-D", "PLATFORM=android-21"];
cppParams = ["-Dandroid", "-DPLATFORM=android-21"];

haxeParams.push("-D");
haxeParams.push("HXCPP_X86_64");
cppParams.push("-DHXCPP_X86_64");
Expand Down Expand Up @@ -284,10 +278,10 @@ class AndroidPlatform extends PlatformTarget

var commands = [];

if (armv5) commands.push(["-Dandroid", "-DPLATFORM=android-16"]);
if (armv7) commands.push(["-Dandroid", "-DHXCPP_ARMV7", "-DHXCPP_ARM7", "-DPLATFORM=android-16"]);
if (armv5) commands.push(["-Dandroid", "-DPLATFORM=android-21"]);
if (armv7) commands.push(["-Dandroid", "-DHXCPP_ARMV7", "-DHXCPP_ARM7", "-DPLATFORM=android-21"]);
if (arm64) commands.push(["-Dandroid", "-DHXCPP_ARM64", "-DPLATFORM=android-21"]);
if (x86) commands.push(["-Dandroid", "-DHXCPP_X86", "-DPLATFORM=android-16"]);
if (x86) commands.push(["-Dandroid", "-DHXCPP_X86", "-DPLATFORM=android-21"]);
if (x64) commands.push(["-Dandroid", "-DHXCPP_X86_64", "-DPLATFORM=android-21"]);

CPPHelper.rebuild(project, commands);
Expand Down

0 comments on commit 8397294

Please sign in to comment.