To add a custom C++ library, you need to put the library (.a) and headers in a zip file, then add the following to build.gradle in the model {}
section.
model {
libraries {
mylib(jaci.gradle.nativedeps.NativeLib) {
headerDirs << 'cpp'
staticMatchers << '**/*.a'
file = project.file("lib/mylibrary.zip")
targetPlatforms << wpi.platforms.roborio
}
}
}
The above assumes the headers are located in the “cpp” directory of the .zip file, adjust as desired.
And then add ‘mylib’ to the useLibrary() call in the frcUserProgram section later in build.gradle, e.g. useLibrary(it, "wpilib", "mylib")
If you want to add custom linker args, that can be done by adding a binaries.all section in frcUserProgram, e.g.
binaries.all {
linker.args("-L...", "-l...")
}