We need to specify a custom GCC/G++ compiler location using Gradle's cpp-library and cpp-application plugins. According to the docs tool chain section:
Linux To build on Linux, install a compatible version of GCC or Clang. The C++ plugins will discover GCC or Clang using the system PATH.
Prepending the PATH environment variable with a path to the desired g++ doesn't seem to get picked by Gradle.
How can you direct Gradle to get GCC/G++ from a custom path?