fix handling of swig so it is run at compile time instead of when