You could have a compile script that would get the git hash and generate the version_string file automatically before compiling.