Yes and no. The IDE runs in its own thread and performs the compilation. Prolog flags are thread-specific, where a new thread copies the flags from its parent (actually, they share but implement copy-on-write such that subsequent changes are only visible in the calling thread.
So, this works perfectly fine if you load the program from the thread in which you will run the program. Typically you should load and init code that requires global changes to the flags in the main threads before creating any other threads. And of course it is dangerous in general as parts of your program may assume different settings