Force specific compiler (gradle native)

Is there a way to force gradle to use a specific compiler?

For example I exported the environment variable CXX=gcc-7, but it still uses the default gcc compiler.

Googling and similar yielded nothing