How to pick toolchain to be used?

I have several versions of different compilers installed on my system and I want my build to work with all of them. But, at some occasions, I want to force build system to use single particular compiler (e.g. I want to compile everything with gcc 4.8 and I do not want to spend any time on other versions of gcc, nor any version of clang at that particular run). With Boost.Build, I can just say ./bjam toolset=g++-4.8, which is defined in my configuration file and I will force that particular compiler (potentially with particular flags) to be used. Is there any way of achieving similar effect using Gradle?