Each of GHC's command line options is classified as either static or dynamic. A static flag may only be specified on the command line, whereas a dynamic flag may also be given in an OPTIONS pragma in a source file or set from the GHCi command-line with :set.
As a rule of thumb, options which relate to filenames are static, and the rest are dynamic. The flag reference tables (Section 4.17) lists the status of each flag.