move lib condition to platform.cmake