-
Notifications
You must be signed in to change notification settings - Fork 110
Linux ARM64 natives support #181
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
base: master
Are you sure you want to change the base?
Changes from all commits
c26afcb
d97ccb2
17516ae
a5ccc5e
16a4b61
baf9e2e
9cb0711
1978634
e599371
96374a6
dd043b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| FROM docker.io/azul/zulu-openjdk:8-latest | ||
|
|
||
| # Install dependencies | ||
| RUN apt update && apt install -y libasound2-dev libdrm-dev libsdl2-dev libgbm-dev libglew-dev ant binutils g++ | ||
|
|
||
| # Copy the repository | ||
| COPY . /home/Arc | ||
| WORKDIR /home/Arc | ||
|
|
||
| # Run the SDL build | ||
| RUN ./gradlew backends:backend-sdl:jnigenBuildLinuxARM64 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| sourceSets.main.java.srcDirs = ["src"] | ||
| sourceSets.main.resources.srcDirs = ["libs/linux64", "libs/macosx64","libs/windows32", "libs/windows64", "libs/openal"] | ||
| sourceSets.main.resources.srcDirs = ["libs/linux64", "libs/linuxarm64", "libs/macosx64","libs/windows32", "libs/windows64", "libs/openal"] | ||
|
|
||
| dependencies { | ||
| testImplementation libraries.jnigen | ||
|
|
@@ -79,15 +79,6 @@ jnigen{ | |
| cIncludes = ["*.c", "glew-2.2.0/src/glew.c"] | ||
| headerDirs += ["glew-2.2.0/include"] | ||
| } | ||
| add(Linux, x64){ | ||
| cppFlags += " " + execCmd("sdl2-config --cflags") | ||
| cFlags = cppFlags | ||
| //NOTE: for this to statically link properly, you need to add -L/path/to/folder/with/custom/libSDL2.a | ||
| //where this folder contains a custom build of SDL2 with the -fPIC flag (added to the makefile in the cflags section after configure) | ||
| //--static-libs and ?.replace("-lSDL2", "-l:libSDL2.a") | ||
| libraries = execCmd("sdl2-config --libs") + " -Wl,-Bdynamic -lGL " | ||
| linkerFlags = "-shared -m64" | ||
| } | ||
|
Comment on lines
-82
to
-90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @k8ieone! I am looking into syncing your PR with upstream, and found this strange diff: you seem to have moved this gradle job lower in the file. I just wanted to know if it is deliberate or just a mistake
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think it was intentional. It looks like I reused the |
||
| add(Windows, x64){ | ||
| def path = "SDL2-$sdlVersion/x86_64-w64-mingw32" | ||
| def root = "$rootDir/backends/backend-sdl/jni" | ||
|
|
@@ -113,6 +104,15 @@ jnigen{ | |
| linkerFlags = "-shared -arch x86_64 -mmacosx-version-min=10.9 -stdlib=libc++" | ||
| libraries = "/usr/local/lib/libSDL2.a -lm -liconv -Wl,-framework,CoreAudio -Wl,-framework,CoreHaptics -Wl,-weak_framework,GameController -Wl,-framework,OpenGL,-weak_framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal /usr/local/lib/libGLEW.a" | ||
| } | ||
| add(Linux, x64){ | ||
| cppFlags += " " + execCmd("sdl2-config --cflags") | ||
| cFlags = cppFlags | ||
| //NOTE: for this to statically link properly, you need to add -L/path/to/folder/with/custom/libSDL2.a | ||
| //where this folder contains a custom build of SDL2 with the -fPIC flag (added to the makefile in the cflags section after configure) | ||
| //--static-libs and ?.replace("-lSDL2", "-l:libSDL2.a") | ||
| libraries = execCmd("sdl2-config --libs") + " -Wl,-Bdynamic -lGL " | ||
| linkerFlags = "-shared -m64" | ||
| } | ||
| }else{ | ||
|
|
||
| //doesn't work on CI, have to use native M1 | ||
|
|
@@ -122,6 +122,15 @@ jnigen{ | |
| //execCmd("sdl2-config --static-libs") + " -Wl,-framework,OpenGL" | ||
| libraries = "/usr/local/lib/libSDL2.a -lm -liconv -Wl,-framework,CoreAudio -Wl,-weak_framework,GameController -Wl,-framework,OpenGL,-weak_framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-weak_framework,QuartzCore -Wl,-weak_framework,Metal /usr/local/lib/libGLEW.a" | ||
| } | ||
| add(Linux, x64, ARM){ | ||
| cppFlags += " " + execCmd("sdl2-config --cflags") | ||
| cFlags = cppFlags | ||
| //NOTE: for this to statically link properly, you need to add -L/path/to/folder/with/custom/libSDL2.a | ||
| //where this folder contains a custom build of SDL2 with the -fPIC flag (added to the makefile in the cflags section after configure) | ||
| //--static-libs and ?.replace("-lSDL2", "-l:libSDL2.a") | ||
| libraries = execCmd("sdl2-config --libs") + " -Wl,-Bdynamic -lGL " | ||
| linkerFlags = "-shared" | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
@@ -130,4 +139,4 @@ getTasksByName("jnigen", true).each{ | |
| it.dependsOn preJni | ||
| it.dependsOn classes | ||
| it.dependsOn aproj(":arc-core").getTasksByName("compileJava", true) | ||
| } | ||
| } | ||
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.
Is it possible to move this somewhere else to avoid polluting the root directory?
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.
Sure thing! I'd go for either the .github folder if GitHub doesn't mind or some other folder like .ci or something in that spirit.
Do you have a place in mind for it?