It is not mandatory and these things (build settings and IDE mode) are not depend on each other in ~ 99.9% percent of cases.
What I mean by 0.1%. There is a very limited set of code constructions, that are possible in K1 compiler and lead to error in K2 compiler. So K2-IDE mode will highlight such code as red, whereas it will be compilable by K1 compiler.
K1/K2 -IDE mode only defines how code will be analyzed in IDE, but doesn’t affect build settings.