Make sure optimizations are removed when NO_OPTIMIZE CMake flag is set.