Code to be run at compile time

Is it possible to write some code (blueprint or c++, I don’t mind) that will run at compile time?
I want to automatically take some volume samples from the audio I have in game and store them in a lookup table for later use.
I know I could add this to be run at the start of the game each time, but it seems awfully wasteful given that the sound aren’t different each time you play.

Thanks,