Build graft as a library