Add pre_compile and post_compile support