Hi all,
I am trying to link a static library to another static but I can’t make it work.
I have seen multiple examples available on this forum and on github but it doesn’t help.
Here is my build.gradle:
apply plugin: 'cpp'
model {
buildTypes {
debug
release
}
repositories {
lib(PrebuiltLibraries) {
Secur32 {
headers.srcDir "C:/Program Files/Microsoft SDKs/Windows/v7.0/Include"
binaries.withType(StaticLibraryBinary) {
staticLibraryFile = file("C:/Program Files/Microsoft SDKs/Windows/v7.0/Lib/Secur32.lib")
}
}
}
}
components {
MyStaticLib(NativeLibrarySpec) {
sources {
cpp {
source {
srcDirs "implementation"
include "**/*.cpp"
}
exportedHeaders {
srcDirs "interface",
include "**/*.h", "**/*.hpp"
}
lib library: 'Secur32', linkage: 'static'
}
}
}
}
}
binaries.withType(SharedLibraryBinary) { binary ->
buildable = false
}
When I look at the tmp file created with the options passed to the linker, I can’t see the options that I need which are:
/OUT:“${path_to_my_lib}\MyStaticLib.lib” Secur32.lib
I tried to directly add these options to linker.args but it doesn’t work either.
Am I missing something ?
Thanks.