Include pre-built libraries in native binary projects

How can I reference the pre-builts project libraries in a task (as described in the 1.11 release notes in section “Include pre-built libraries in native binary projects”)?

I’m trying to implement this as well and found the gradle example at which worked for me fairly well.

Thank you very much - worked like a charm.


You can do one of the two variants:

executables {

main {} } sources.main.cpp.lib library: ‘boost’, linkage: ‘api’ sources.main.cpp.lib library: ‘util’, linkage: ‘static’ task buildExecutables {

dependsOn binaries.withType(ExecutableBinary) }


executables {

main {

cpp {



lib library: ‘boost’, linkage: ‘api’


} }