Fixed #21558 -- Support building CHM files.

Thanks Michał Pasternak.