Use check_symbol_exists instead of check_function_exists
check_function_exists has some shortcomings, which fails to detect
isnan when build against musl libc. The cmake documentation 
suggests to prefer check_symbol_exists, which detects isnan/isinf
fine on both glibc and musl.
Test Plan: Builds with glibc and musl
Differential Revision: https://phabricator.kde.org/D18866