Ok got it working. Like you mentioned about the changes in the nightly release notes, I had to place the cppCompiler lines inside curlybraces after a call to eachPlatform(). I assume there’s a property that tells you what platform is the current one but I haven’t figured that out yet.
It seems it will create the .dll file but hasn’t made the .a file. I suspect it’s because my headers aren’t in the src/${name}/headers directory (the whole thing isn’t structured right because I am trying out Gradle after using CMake for my own C++ projects for a while). I’ll edit this post if I get that working too.
EDIT: Got it to generate a .a file, but with odd results. To get it to generate it at all, I had to manually add the flags that would make it generate the file.
libraries {
ResourcePacker {
targetPlatforms "linux_x86", "linux_x86_64", "windows_x86", "windows_x86_64"
binaries.all {
cppCompiler.args "-std=c++11", "-Wall", "-Wextra"
if(buildType == buildTypes.debug) {
cppCompiler.args "-O0", "-g"
}
if(buildType == buildTypes.release) {
cppCompiler.define "NDEBUG"
cppCompiler.args "-O3"
}
if(targetPlatform.getDisplayName().endsWith("'linux_x86'")) {
cppCompiler.args "-m32", "-march=i686", "-mtune=generic"
linker.args "-m32"
}
if(targetPlatform.getDisplayName().endsWith("'windows_x86'")) {
cppCompiler.args "-I/usr/i686-w64-mingw32/include"//, "-nostdinc", "-nostdinc++"
linker.args "-Wl,--out-implib,libResourcePacker.a"
}
if(targetPlatform.getDisplayName().endsWith("'windows_x86_64'")) {
cppCompiler.args "-I/usr/x86_64-w64-mingw32/include"//, "-nostdinc", "-nostdinc++"
linker.args "-Wl,--out-implib,libResourcePacker.a"
}
}
}
}
And when it did generate the file, it was placed in the same directory as the build.gradle script.
Hopefully this will be fixed in the future?
EDIT2: Oh, didn’t realize the property that I couldn’t figure out was the exact same name as what it’s for. “platform”. Unfortunately it’s a little finicky to check against (unless there’s also a very obvious method for it). So until I figure that out, I may use “platform.getDisplayName().endsWith(”‘linux_x86’")" for specific platforms.