Skip to content

Conversation

dkimitsa
Copy link
Contributor

@dkimitsa dkimitsa commented Feb 1, 2022

problem

  1. it was not possible to generate arm64-simulator slice as only <arch>arm64</arch> was allowed;
  2. once arm64-simulator is generated it is not possible to lipo both arm64 and arm64-simulator into single fat binary

support for <arch>arm64-simulator</arch>

It was required to allow arch to contain both CPU arch and environment. To achieve this Arch enum was renamed into CpuArch and Arch value object is introduced that combines CpuArch and Environment. Code was refactored to work with new object (in future we might extend it with OS and have complete triple).

combining arm64 and arm64-simulator

Lipo is unable to make fat binary for binaries of same CPU arch. And apple tells to produce xcframework instead.
Changes were done to do following:

  • combine CPU slices that belongs to same Environment (e.g. Simulator) into fat binaries;
  • create framework for these fat binaries (e.g. with own copy of assets/resource etc)
  • produce Info.plist that describes xcframework structure

robovm.xml has to specify following target:

    <target>xcframework</target>

eclipse plugin

can now run on m1 Mac and launch on arm64 sim

other fixes

CpuArch default arch was picked from LLVM_HOST_TRIPLE which specified host where LLVM lib was compiled, not actually host it is now running on.
As result it affected default arch selection for Console/Framework targets. Reworked to use System.getProperty("os.arch")

adds support for extended `arch` strings to support strings like `arm64-simulator`.
its required to allow framework targets to be built with `arm64-simulator` slice.
to achieve this:
 - `Arch` enum was renamed into `CpuArch`;
 - instead `Arch` class was introduced that combines both `CpuArch` and `Environment` enums
- combining device arches and simulator ones into separate binaries
- for each binary standalone structure of framework is generated with own set of resources
- structure of xcframework with info.plist is generated
…h specified host where LLVM lib was compiled, not actually host it is now running on.

As result it affected default arch selection for Console/Framework targets
Reworked to use `System.getProperty("os.arch")`
@dkimitsa dkimitsa marked this pull request as ready for review February 2, 2022 11:41
@Tom-Ski Tom-Ski merged commit 92ee1f4 into MobiVM:master Feb 2, 2022
@dkimitsa dkimitsa deleted the xcframework/framework-target branch February 3, 2022 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants