1

I like to enable optimization for a single file in debug build. The code in the file performance_critical.cpp is very slow in debug mode and I hope to improve the debug performance. My plan is to switch on optimization for only one specific file.

I already tried: set_source_files_properties(performance_critical.cpp PROPERTIES COMPILE_FLAGS /O2 COMPILE_FLAGS /Ob2)

This seems to not do the job. Thanks for your help.

Thomas m
  • 133
  • 4
  • I think what you are asking already has an [answer](https://stackoverflow.com/a/47927921/3987854) on this site, except you are *enabling* optimization, not *disabling*. So just replace the flag in that answer with yours (`/O2`). – Kevin Mar 17 '20 at 15:00

1 Answers1

0

No Idea what i did wrong in the first place. Exactly the line of code i posted seems to work.

Thomas m
  • 133
  • 4