--optimize 4
would correspond to Release.
--optimize 1
and 2
would correspond to Debug.
--optimize 3
is a bit of a weird one, it is technically Release mode in that it has a lot of optimizations but we do include a lot of assertion checks and other debugging information. In our CMake scripts we created a new mode for this called “Standard”.
I think we built our thirdparty packages in Release mode. See: