Add ifdef for static library building.
Merge branches 'develop' and 'tesla-support' into develop