[Unreal]macosで変数「LayerName」setを構築しても[-Werror,-Wusned-but-set-avariable]を使用していない場合、エラーが発生します.


UE4 4.27.2
macOS Monterey 12.3.1
Rider 2022.1 EAP 9
Xcode 13.3
Xcode更新後、MacOSでC++プロジェクト構築時に以下のエラーが発生したプロジェクトがあります.
variable “LayerNames” set but not used [-Werror,-Wunused-but-set-variable]
Xcodeの更新に伴い、より厳密なコンパイルを実行中に発生したエラー.
Xcodeバージョンを13.2.1(Apple Developerリンクのダウンロード)またはプロジェクトターゲットに置き換えます.csファイルに以下のコードを追加すると解決します.
bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = "-Wno-unused-but-set-variable";
ソース:地下フォーラム