def METHOD_NAME(self):
    if self.options.shared:
        self.options.rm_safe("fPIC")
    if Version(self.version) < "8.2.0":
        del self.options.throw_bad_alloc_library
    if not self.options.cplusplus:
        self.settings.rm_safe("compiler.libcxx")
        self.settings.rm_safe("compiler.cppstd")