Enable build optimizations and set tool chains