to alleviate problems caused by the circular dependency of using the same code as a library that is potentially being generated to adhere to a different API.
Closes #1381