add build option for tern