Compiling libuv dependency does not respect compiler choice

When building bundled dependencies using CMake I want to specify non-default compiler. This seems to work.

pwd
…/download/neovim-master/.deps
cmake -DCMAKE_C_COMPILER=gcc …/cmake.deps
– The C compiler identification is GNU 10.1.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /opt/gcc-10.1.0/bin/gcc - skipped

However, when I try building libuv it chooses default compiler during configuration step and ultimately fails.

[ 50%] Performing configure step for ‘libuv’
loading initial cache file …/download/neovim-master/.deps/build/tmp/libuv-cache-Debug.cmake
– The C compiler identification is GNU 4.8.5
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/bin/cc - skipped