Cpp library: build task compiles only debug variant

I’m using Gradle 5.5 and cpp-library-plugin for a simple native library. And I don’t know why but by default gradle build only assembles a debug version. I have to call gradlew assembleReleaseX86-64 to get a release version.

Does someone know how I can do debug and release builds?

plugins {

library {
    targetMachines.set(listOf(machines.windows.x86, machines.windows.x86_64))

extensions.configure<CppLibrary> {
    privateHeaders.from(file("C:/Program Files/Java/jdk1.8.0_171/include"), file("C:/Program Files/Java/jdk1.8.0_171/include/win32"))

tasks.withType(LinkSharedLibrary::class.java).configureEach {

That is the default behavior. You need to use this task.
You need to use assembleRelease