Compiling a snap with Clang instead of GCC

Hello, I am trying to create a snap, in which the source code is written in C and C++ and is built with the cmake generator. However, this source code doesn’t support being compiled with GCC, it must be compiled with Clang. When building the software on a regular platform, I can simply prepend CC=clang CXX=clang++ to the cmake command, however on Snap, I am not able to do that, and it defaults to building with GCC which obviously fails. Is there a way to specify which C compiler to use in the snapcraft.yaml file? Thanks in advance.

you can use build-environment: for that: