Slackbot
04/18/2022, 2:17 PMGiuseppe Barbieri
04/18/2022, 2:18 PM[Compiler] Executing 'gcc' with arguments:
[Compiler] '-c'
[Compiler] '-m64'
[Compiler] '-O3'
[Compiler] '-flto'
[Compiler] '-fPIC'
[Compiler] '-pthread'
[Compiler] '-DNDEBUG'
[Compiler] '-DLWJGL_LINUX'
[Compiler] '-DLWJGL_x64'
[Compiler] '-U_FORTIFY_SOURCE'
[Compiler] '-D_FORTIFY_SOURCE=0'
[Compiler] '-D_GNU_SOURCE'
[Compiler] '-D_FILE_OFFSET_BITS=64'
[Compiler] '-I/usr/lib/jvm/java-11-openjdk-amd64/include'
[Compiler] '-I/usr/lib/jvm/java-11-openjdk-amd64/include/linux'
[Compiler] '-I../../../../modules/lwjgl/core/src/main/c'
[Compiler] '-I../../../../modules/lwjgl/core/src/main/c/linux'
[Compiler] '-I../../../../modules/lwjgl/core/src/main/c/linux/liburing'
[Compiler] '-I../../../../modules/lwjgl/core/src/main/c/linux/liburing/include'
[Compiler] '-DCONFIG_HAVE_MEMFD_CREATE'
[Compiler] '/home/elect/IdeaProjects/lwjgl3/modules/lwjgl/core/src/main/c/linux/liburing/queue.c'
[Compiler] '/home/elect/IdeaProjects/lwjgl3/modules/lwjgl/core/src/main/c/linux/liburing/register.c'
[Compiler] '/home/elect/IdeaProjects/lwjgl3/modules/lwjgl/core/src/main/c/linux/liburing/setup.c'
[Compiler] '/home/elect/IdeaProjects/lwjgl3/modules/lwjgl/core/src/main/c/linux/liburing/syscall.c'
daniel
04/18/2022, 2:39 PMdaniel
04/18/2022, 2:54 PMdev.nokee.jni-library
with regards to what you need to do for configuring, I would estimate the build script to be something similar to the following:
plugins {
id 'dev.nokee.jni-library'
id 'dev.nokee.c-language'
id 'java'
}
library {
targetMachine = [machines.linux.x86_64]
variants.configureEach {
sharedLibrary {
compileTasks.configureEach {
compilerArgs.addAll(['-O3', '-flto', '-fPIC', '-pthread', '-DNDEBUG', '-DLWJGL_LINUX', '-DLWJGL_x64', '-D_FORTIFY_SOURCE', '-D_FORTIFY_SOURCE=0', '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64', '-DCONFIG_HAVE_MEMFD_CREATE'])
}
}
}
}
For the includes and sources, I will need a bit more info as the relative path doesn’t confirm if the includes are part of the project or not. In general, the sources you declare on the library
DSL is wired into the compile tasks automatically.Giuseppe Barbieri
04/18/2022, 3:31 PMGiuseppe Barbieri
04/18/2022, 3:32 PMbuild
macro is defined a little earlier, at line 61Giuseppe Barbieri
04/18/2022, 4:17 PM.c
files (first normal sources and then generated sources) into .o
files and then linkGiuseppe Barbieri
04/19/2022, 7:40 AM