Fix source generation for library projects