Commit c987c97 added a DllMain function, which is unconditionally added, even when OPENCL_ICD_LOADER_BUILD_SHARED_LIBS is off.
This leads to DllMain being part of the resulting static library, which then causes a linker error when trying to link it into another shared library, like FFmpeg in this case.
Defining a DllMain function should only happen when actually building a shared library.