I think your cmake call may be a better place for it. From what I'm reading, this option comes with a penalty and if you add it to -DCMAKE_CXX_FLAGS_DEBUG it'll only be used for the debug build where its required