It is the duty of the county legislative body to erect a courthouse, jail, and other necessary county buildings.