fix XCode build error when used as library.