Home > Blockchain >  How to change the optimization level?
How to change the optimization level?

Time:09-22

I have the project which uses my second project as a lib. I see that them two has optimization level for debug none -o0 and for the release fast -0s

but in spite of this in the log, I see such a message

... was compiled with optimization - stepping may behave oddly; variables may not be available.

What are possible ways to fix it?

P.S. should be mentioned that debug doesn't work. It stops on the breakpoint, but I don't see the values of variables.

UPD

my second project - it is a lib. The structure looks like this

enter image description here

Demo - is a project

Lib - is lib

Let me know if I missed something

CodePudding user response:

The build settings are tied to configurations. In your build settings for optimization, the Debug configuration is set to nonoptimized, and the Release configuration is set to optimized.

So far, so good.

But which configuration are you actually using when you build? That is determined by the scheme. Use the Scheme Editor to look at the schemes for your different targets. (You will have to look at them one at a time.) In each, look in the Run action. It says which configuration to use. If the pop-up says Release, change it to Debug.

  • Related