HaxeFoundation / HaxeFoundation/hxcpp
toolchains: refactor architecture flags
- Dominant language
- C++
- Stars
- 330
- Forks
- 227
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 18
Description
Currently you can only specify architectures explicitly used in the toolchain XML (eg [iphoneos-toolchain.xml#44](https://github.com/HaxeFoundation/hxcpp/blob/e23515d4acd43f3609e5ca49a8cebdad285db78d/toolchain/iphoneos-toolchain.xml#L44))
But other similar toolchains might not make all the same architectures available (eg [watchos-toolchain.xml#17](https://github.com/HaxeFoundation/hxcpp/blob/e23515d4acd43f3609e5ca49a8cebdad285db78d/toolchain/watchos-toolchain.xml#L17)). Users may try using HXCPP_M64 and HXCPP_ARM64 on targets that don't explicitly use those in the XML and find that they're unexpectedly ignored (despite being a perfectly valid arch for that target). Additionally, the names don't always match the arch flag names making it difficult to know exactly what HXCPP_ flag you need to use. See this thread for an example: https://community.haxe.org/t/missing-hxcpp-h-in-cpp-compilation/2975/15
I suggest a `-D HXCPP_ARCH={name}` flag that's passed into the compiler's -arch flag
This is especially important now because [Xcode 12 by default want to you build .a files for multiple architectures](https://developer.apple.com/forums/thread/660782), and with architectures changing year to year, users want to adjust the arch flags without the maintenance burden of editing the toolchains
Happy to assign this to myself and implement in a fully backward compatible way for all targets, supporting the existing HXCPP_ flags
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.