However, it seems that the Exec does not persist when written in this way. The function and variable are created and may be called upon at runtime. If I comment out the preprocesser lines, the function does properly show up in the console.
I am doing this to create very simple debug functionality that can be run in the editor or in a normal development runtime build that is not “SHIP”
Any tips or suggestions to solve this would be much appreciated!
To understand this problem you need to understand that U-macros (UFUNCTION, UCLASS etc.) are only used by Unreal Header Tool (UHT) which based on those generates header files which allows engine to see class structure and those macros are ignored during compile time.
I heard that UHT has problems parsing other C++ preprocessing calls so that might be the cause