update build and add ninja support