-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
M1 support #112
M1 support #112
Conversation
Tom-Ski
commented
Feb 11, 2022
- GHA is building arm64 slices
- Library loader detecting arm and 64bit to change choice of native lib
- gdx-jnigen is updated to 2.2.1
- Freetype is now being compiled and built in GHA into a fat library, and then used to link against when building the bindings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to configure an additional matrix build for arm. As it's done for all platforms. Like, no need to build a separate freetype for an amd build. As well as to configure an arm workaround when there is no need of it. Also, check job artefacts and you'll see that now there is only one dylib - the arm one. When it should be two of them.
And don't add to the PR compiled arm binary, they are updated through the CI.
Do you want to separate this at the generateLibs level? Atm type from the matrix is passed directly in, but another entry for arm will need that part adapting too. Or should we just do some logic and feed in 'mac' still to generateLibs for that arm type? Im not sure what you mean by not needing a separate build for arm, that is required. Do you mean no need to separate it when adding a new entry to the build matrix? |
- if: matrix.os == 'macos-latest' | ||
name: Build Setup Mac xcode | ||
run: | | ||
# See https://github.com/actions/virtual-environments/issues/2557 | ||
sudo mv /Library/Developer/CommandLineTools/SDKs/* /tmp | ||
sudo mv /Applications/Xcode.app /Applications/Xcode.app.bak | ||
sudo mv /Applications/Xcode_12.4.app /Applications/Xcode.app | ||
sudo xcode-select -switch /Applications/Xcode.app | ||
/usr/bin/xcodebuild -version | ||
sudo mkdir /opt/freetype | ||
|
||
- if: matrix.os == 'macos-latest' && matrix.freetype == true | ||
name: Download FreeType - Compile & Install | ||
working-directory: /opt/freetype | ||
run: | | ||
# freetype download and untar and install | ||
sudo wget -O freetype.tar.gz ${{ env.FREETYPE_URL }} | ||
sudo tar -xzf freetype.tar.gz -C . --strip-components=1 | ||
|
||
sudo ./configure CFLAGS="-arch arm64 -arch x86_64" --with-zlib=no --with-bzip2=no --with-png=no --with-harfbuzz=no --with-brotli=no | ||
sudo make | ||
sudo make install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need it for amd64 builds.
@@ -25,7 +25,10 @@ | |||
public class ImGui { | |||
private static final String LIB_PATH_PROP = "imgui.library.path"; | |||
private static final String LIB_NAME_PROP = "imgui.library.name"; | |||
private static final String LIB_NAME_DEFAULT = System.getProperty("os.arch").contains("64") ? "imgui-java64" : "imgui-java"; | |||
private static final String LIB_NAME_BASE = "imgui-java"; | |||
private static final boolean is64Bit = System.getProperty("os.arch").contains("64") || System.getProperty("os.arch").startsWith("armv8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified: if it's no ARM, then it's 64 for sure.
@@ -137,6 +147,10 @@ class GenerateLibs extends DefaultTask { | |||
break | |||
case BuildTarget.TargetOs.MacOsX: | |||
target.cppFlags += ' -I/usr/local/include/freetype2' | |||
if (isARM) { | |||
//For GHA | |||
target.cppFlags += ' -I/usr/local/arm64/include/freetype2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That what I was talking about: split builds for different archs.
6c0432c
to
ff9b88d
Compare
hey, any news on that topic? :) |
Closing in favor of #223 |