This is a native (c++) project on Gradle 2.5.
In project B, I have declared a prebuilt, header-only library:
model {
repositories {
// define prebuilt libraries so we can depend on them
libs(PrebuiltLibraries) {
mcu_kernel_includes {
headers.srcDir "${sourceDir}/${repoName}/include"
}
}
}
}
In project A, I try to do an ‘api’ dependency on the prebuilt library from projectB:
lib project: ':projectB', library: 'mcu_kernel_includes', linkage: 'api'
and I get the following error.
* What went wrong:
No shared library binary available for library 'mcu_kernel_includes' with [flavor: 'default', platform: 'arm', buildType: 'debug']
There is no binary, because it is currently a header-only prebuilt library. I am not yet building the library in Gradle, and shouldn’t need it for an ‘api’ linkage. I am successfully using header-only prebuilt libraries within ProjectA.
For example if I define the header only prebuilt library in project A like this:
mcu_kernel_includes {
headers.srcDir '/path/to/mcu_kernel_src/include'
}
and depend on it in projectA like this:
lib library: 'mcu_kernel_includes', linkage: 'api'
it works as expected.
I would expect to be able to define a header-only prebuilt library and do an ‘api’ (header-only) inkage against it from another project.
Thanks