# bash path in Engine\Source\Programs\StandaloneApplication $ UnrealBuildTool.exe -notinstallengine -ProjectFiles StandaloneApplication
注意 :直接在安装版引擎中使用上面的命令会报错(不允许创建非 Game 项目),因为虽然传入了-notinstallengine 参数,但是对 Engine/Build/InstalledBuild.txt 文件检测的优先级高于-notinstallengine:
1 2 3 4
Zhalipeng MINGW64 /d/UE_4.18/Engine/Source/Programs/StandaloneApplication (master) $ ../../../../Engine/Binaries/DotNET/UnrealBuildTool.exe -notinstallengine -ProjectFiles StandaloneApplication ERROR: UnrealBuildTool Exception: A game project path was not specified, which is required when generating project files using an installed build or passing -game on the command line
// Engine/Source/Programs/UnrealBuildTool/Configuration/TargetRules.cs public enum TargetType { // Cooked monolithic game executable (GameName.exe). Also used for a game-agnostic engine executable (UE4Game.exe or RocketGame.exe) Game, // Uncooked modular editor executable and DLLs (UE4Editor.exe, UE4Editor*.dll, GameName*.dll) Editor, // Cooked monolithic game client executable (GameNameClient.exe, but no server code) Client, // Cooked monolithic game server executable (GameNameServer.exe, but no client code) Server, // Program (standalone program, e.g. ShaderCompileWorker.exe, can be modular or monolithic depending on the program) Program, }
using UnrealBuildTool; using System.Collections.Generic;
[SupportedPlatforms(UnrealPlatformClass.All)] public class StandaloneApplicationTarget : TargetRules { public StandaloneApplicationTarget(TargetInfo Target) : base(Target) { Type = TargetType.Program; LinkType = TargetLinkType.Monolithic; LaunchModuleName = "StandaloneApplication"; ExtraModuleNames.Add("EditorStyle"); }
public override void SetupGlobalEnvironment( TargetInfo Target, ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration, ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration ) { // Lean and mean bCompileLeanAndMeanUE = true;
// No editor or editor-only data is needed bBuildEditor = false;
// Whether to compile WITH_EDITORONLY_DATA disabled. Only Windows will use this, other platforms force this to false. //bBuildWithEditorOnlyData = false;
// Compile out references from Core to the rest of the engine bCompileAgainstEngine = false;
// Enabled for all builds that include the CoreUObject project. Disabled only when building standalone apps that only link with Core. bCompileAgainstCoreUObject = true;
// Whether to include plugin support. bCompileWithPluginSupport = true;
// Enable exceptions for all modules bForceEnableExceptions = false;
// Enable RTTI for all modules. // bForceEnableRTTI = true;
// If ture the program entrance is WinMain,otherwise entrance is main bIsBuildingConsoleApplication = false; } }