Skip to content
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

seperate bin directory name for linux arm #1159

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/build_xml/Defines.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ Defines affecting target architecture.
| *HXCPP_ARM64* | Compile arm-based devices for 64 bits |
| *HXCPP_ARMV7* | Compile arm-based devices for armv7 |
| *HXCPP_ARMV7S* | Compile arm-based devices for armv7s |
| *HXCPP_LINUX_ARMV7* | Run on a linux ARMv7 device |
| *HXCPP_LINUX_ARM64* | Run on a linux ARM64 device |
| *winrt* | Compile for windowsRt/windows UWP |
| *android* | Compile for android |
| *PLATFORM* | Specify the android platform for NDK compilation |
Expand Down
6 changes: 5 additions & 1 deletion src/hx/Lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ String __hxcpp_get_bin_dir()
#elif defined(APPLETVOS)
HX_CSTRING("AppleTVOS");
#else
#ifdef HXCPP_M64
#ifdef HXCPP_ARM64
HX_CSTRING("LinuxArm64");
#elif defined(HXCPP_ARMV7)
HX_CSTRING("LinuxArm");
#elif defined(HXCPP_M64)
HX_CSTRING("Linux64");
#else
HX_CSTRING("Linux");
Expand Down
14 changes: 9 additions & 5 deletions tools/hxcpp/BuildTool.hx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class BuildTool
var mNvccLinkFlags:Array<String>;
var mDirtyList:Array<String>;
var arm64:Bool;
var armv7:Bool;
var m64:Bool;
var m32:Bool;

Expand Down Expand Up @@ -134,15 +135,17 @@ class BuildTool
m64 = mDefines.exists("HXCPP_M64");
m32 = mDefines.exists("HXCPP_M32");
arm64 = mDefines.exists("HXCPP_ARM64");
var otherArmArchitecture = mDefines.exists("HXCPP_ARMV6") || mDefines.exists("HXCPP_ARMV7") || mDefines.exists("HXCPP_ARMV7S");
if (m64==m32 && !arm64 && !otherArmArchitecture)
armv7 = mDefines.exists("HXCPP_ARMV7");
var otherArmArchitecture = mDefines.exists("HXCPP_ARMV6") || mDefines.exists("HXCPP_ARMV7S");
if (m64==m32 && !arm64 && !armv7 && !otherArmArchitecture)
{
var arch = mDefines.get("HXCPP_ARCH");
if (arch!=null)
{
m64 = arch=="x86_64";
m32 = arch=="x86";
arm64 = arch=="arm64";
armv7 = arch=="armv7";
}
else
{
Expand All @@ -152,6 +155,7 @@ class BuildTool
m64 = hostArch=="m64";
m32 = hostArch=="m32";
arm64 = hostArch=="arm64";
armv7 = hostArch=="armv7";
}

mDefines.remove(m32 ? "HXCPP_M64" : "HXCPP_M32");
Expand Down Expand Up @@ -2060,21 +2064,21 @@ class BuildTool
defines.set("toolchain","linux");
defines.set("linux","linux");

if (defines.exists("HXCPP_LINUX_ARMV7"))
if (armv7)
{
defines.set("noM32","1");
defines.set("noM64","1");
defines.set("HXCPP_ARMV7","1");
m64 = false;
}
else if (arm64 || defines.exists("HXCPP_LINUX_ARM64"))
else if (arm64)
{
defines.set("noM32","1");
defines.set("noM64","1");
defines.set("HXCPP_ARM64","1");
m64 = true;
}
defines.set("BINDIR", m64 ? "Linux64":"Linux");
defines.set("BINDIR", arm64 ? "LinuxArm64" : armv7 ? "LinuxArm" : m64 ? "Linux64" : "Linux");
}
}
else if ( (new EReg("mac","i")).match(os) )
Expand Down