AirSim在M1pro电脑上编译的踩坑记录
💻系统配置
系统版本:macOS Monterey. 12.6.3 (21G419)
Xcode版本:Version 14.2 (14C18)
虚幻引擎版本:UE_4.27
👀 Problem1
在Xcode上编译时报错**😗*
Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically. Apply an Info.plist file to the target using the INFOPLIST_FILE build setting or generate one automatically by setting the GENERATE_INFOPLIST_FILE build setting to YES (recommended).
!!! Engine和Games的都需要做以下更改哦
解决方式:
Pods -> Build Settings -> Packaging -> Generate Info.plist File = Yes
💭 Problem2
在Xcode上编译时报错**😗*
variable ‘LayerNames’ set but not used [-Werror,-Wunused-but-set-variable]
解决方式:
对/Users/chauncy/Documents/Unreal Projects/AirSim/Unreal/Environments/Blocks/Source中的两个.cs文件都添加如下字段。
修改后的Blocks.Target.cs:// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. using UnrealBuildTool; using System.Collections.Generic; public class BlocksTarget : TargetRules { public BlocksTarget(TargetInfo Target) : base(Target) { Type = TargetType.Game; ExtraModuleNames.AddRange(new string[] { "Blocks" }); bOverrideBuildEnvironment = true; AdditionalCompilerArguments = "-Wno-unused-but-set-variable"; //bUseUnityBuild = false; if (Target.Platform == UnrealTargetPlatform.Linux) bUsePCHFiles = false; } }
修改后的BlocksEditor.Target.cs:
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. using UnrealBuildTool; using System.Collections.Generic; public class BlocksEditorTarget : TargetRules { public BlocksEditorTarget(TargetInfo Target) : base(Target) { Type = TargetType.Editor; ExtraModuleNames.AddRange(new string[] { "Blocks" }); DefaultBuildSettings = BuildSettingsVersion.V2; bOverrideBuildEnvironment = true; AdditionalCompilerArguments = "-Wno-unused-but-set-variable"; //bUseUnityBuild = false; //bUsePCHFiles = false; } }
I work fine for Xcode 13.3 by adding following lines to .target.cs file in my project:
bOverrideBuildEnvironment = true; AdditionalCompilerArguments = "-Wno-unused-but-set-variable";
参考链接:https://forums.unrealengine.com/t/layernames-error-bricking-my-mac-projects/508040/8
🛫 最后
🚀 直接编译即可