Is the endianness of floats and integers a property of the compiled program, such that I can check it at compile time with an assertion somehow?
It's decided at compile time which machine code is generated. A program cannot be compiled to machine code, that works on completely different CPU architectures.
To check at runtime which endianess is used at your current hardware, there are several methods available.
Also see Determining endianness at compile time.
Instead of using assertions for assuming a particular endianess in your code, you should use techniques to make any data saved to files, or communicated over a network connection transparent regarding endianess.
One way to do so, is to specify only big endian data should be used, and the code uses the hton<x>(), ntoh<x>() family of functions to encode and decode the data (see also network byte order).