Hi, I am an absolute beginner. I’m trying to create a C static library on Windows, after having read much documentation. Here is my build.gradle contents:
/*
- Create Windows static C library myLib.lib
*/
apply plugin: ‘c’
model {
components {
myLib(NativeLibrarySpec) {
sources {
c {
source {
srcDirs "src/cpp"
include "*.c"
}
}
}
}
}
binaries {
withType(StaticLibraryBinarySpec) {
if (toolChain in VisualCpp) {
cppCompiler.define "DLL_EXPORT"
cppCompiler.args "/DIBMRS6000"
}
}
}
}
When I type “gradlew irpGrouper64StaticLibrary”, it reports a number of C compile errors. Analysis tells me that these can be avoided by specifying a command-line compiler flag of /DIBMRS6000, as an equivalent to #define IBMRS6000 in all files. As you see, I put that flag into a line cppComputer.args, but apparently that was not the right way to do that. Any suggestions would be welcomed.
Thanks in advance, mshulman256 (Michael Shulman)