Automatically select a suitable platform from flag