Move build_static outside all.