When I was a kid we had a pig occasionally, then one of my sisters raised a few every year for her FFA project. My dad built a special pen for them that was concrete floored with a roof cover for sun protection. At the end of one side, outside the fence he dug a big pit. I think it was probably about 6 feet deep and probably four feet wide. Twice a day the poo was shoveled into it, and a couple times a week the whole concrete floor got hosed down. It was very clean, and I don't remember any bad smells at all. Our neighbors never complained.
But if you think goats are hard to contain, pigs are 10 times worse. Dad built their pen with railroad ties, and the roof was a half drainage culvert.