Native compilation - shared library only

Hello all,

is there a better approach to compile native shared library only?

Following works but prints “SKIPPED”

gradle.taskGraph.whenReady {
 graph ->
  graph.getAllTasks().findAll {
        task -> task.name.contains('StaticLibrary')
   }.each {
    task -> task.enabled false
  }
}

Thank you