If anyone knows if there is a specific reason why certain tasks for native development in Gradle core (Assemble, LinkExecutable, CreateStaticLibrary) are not cacheable, I would be happy to hear about that. I created this PR:
https://github.com/gradle/gradle/pull/22993