[CMake] Move -stdlib=libc++ handling into its own file.