UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Build.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5/*--------------------------------------------------------------------------------
6 Build configuration coming from UBT, do not modify
7--------------------------------------------------------------------------------*/
8
9// Set any configuration not defined by UBT to zero
10#ifndef UE_BUILD_DEBUG
11 #define UE_BUILD_DEBUG 0
12#endif
13#ifndef UE_BUILD_DEVELOPMENT
14 #define UE_BUILD_DEVELOPMENT 0
15#endif
16#ifndef UE_BUILD_TEST
17 #define UE_BUILD_TEST 0
18#endif
19#ifndef UE_BUILD_SHIPPING
20 #define UE_BUILD_SHIPPING 0
21#endif
22#ifndef UE_GAME
23 #define UE_GAME 0
24#endif
25#ifndef UE_CLIENT
26 #define UE_CLIENT 0
27#endif
28#ifndef UE_EDITOR
29 #define UE_EDITOR 0
30#endif
31#ifndef UE_BUILD_SHIPPING_WITH_EDITOR
32 #define UE_BUILD_SHIPPING_WITH_EDITOR 0
33#endif
34#ifndef UE_BUILD_DOCS
35 #define UE_BUILD_DOCS 0
36#endif
37
41#ifndef UE_SERVER
42 #define UE_SERVER 0
43#endif
44
45// Ensure that we have one, and only one build config coming from UBT
46#if UE_BUILD_DEBUG + UE_BUILD_DEVELOPMENT + UE_BUILD_TEST + UE_BUILD_SHIPPING != 1
47 #error Exactly one of [UE_BUILD_DEBUG UE_BUILD_DEVELOPMENT UE_BUILD_TEST UE_BUILD_SHIPPING] should be defined to be 1
48#endif
49
50/*--------------------------------------------------------------------------------
51 Legacy defined we want to make sure don't compile if they came in a merge.
52--------------------------------------------------------------------------------*/
53
54#define FINAL_RELEASE_DEBUGCONSOLE (#)
55#define FINAL_RELEASE (#)
56#define SHIPPING_PC_GAME (#)
57#define UE_BUILD_FINAL_RELEASE (#)
58
59/*----------------------------------------------------------------------------
60 Mandatory bridge options coming from UBT, do not modify directly!
61----------------------------------------------------------------------------*/
62
66#ifndef WITH_EDITOR
67 #define WITH_EDITOR 0 // for auto-complete
68 #error UBT should always define WITH_EDITOR to be 0 or 1
69#endif
70
74#ifndef WITH_ENGINE
75 #define WITH_ENGINE 0 // for auto-complete
76 #error UBT should always define WITH_ENGINE to be 0 or 1
77#endif
78
82#ifndef WITH_UNREAL_DEVELOPER_TOOLS
83 #define WITH_UNREAL_DEVELOPER_TOOLS 0 // for auto-complete
84 #error UBT should always define WITH_UNREAL_DEVELOPER_TOOLS to be 0 or 1
85#endif
86
90#ifndef WITH_UNREAL_TARGET_DEVELOPER_TOOLS
91 #define WITH_UNREAL_TARGET_DEVELOPER_TOOLS WITH_UNREAL_DEVELOPER_TOOLS // a subset of WITH_UNREAL_DEVELOPER_TOOLS, but can be disabled separately
92#endif
93
97#ifndef WITH_PLUGIN_SUPPORT
98 #define WITH_PLUGIN_SUPPORT 0 // for auto-complete
99 #error UBT should always define WITH_PLUGIN_SUPPORT to be 0 or 1
100#endif
101
105#ifndef WITH_ACCESSIBILITY
106 #define WITH_ACCESSIBILITY 1
107#endif
108
110#ifndef WITH_PERFCOUNTERS
111 #define WITH_PERFCOUNTERS 0
112#endif
113
115#define USE_SERVER_PERF_COUNTERS ((UE_SERVER || UE_EDITOR) && WITH_PERFCOUNTERS)
116
120#ifndef ENABLE_PGO_PROFILE
121 #define ENABLE_PGO_PROFILE 0
122#endif
123
126#ifndef WITH_AUTOMATION_WORKER
127 #define WITH_AUTOMATION_WORKER !UE_BUILD_SHIPPING
128#endif
129
133#ifndef IS_MONOLITHIC
134 #define IS_MONOLITHIC 0 // for auto-complete
135 #error UBT should always define IS_MONOLITHIC to be 0 or 1
136#endif
137
141#ifndef IS_PROGRAM
142 #define IS_PROGRAM 0 // for autocomplete
143 #error UBT should always define IS_PROGRAM to be 0 or 1
144#endif
145
149#ifndef WITH_HOT_RELOAD
150 #define WITH_HOT_RELOAD (!IS_MONOLITHIC && !UE_BUILD_SHIPPING && !UE_BUILD_TEST && !UE_GAME && !UE_SERVER)
151#endif
152
156#ifndef WITH_LIVE_CODING
157 #define WITH_LIVE_CODING 0
158#endif
159
163#define WITH_RELOAD (WITH_HOT_RELOAD || WITH_LIVE_CODING)
164
169#ifndef WITH_TEXT_ARCHIVE_SUPPORT
170 #define WITH_TEXT_ARCHIVE_SUPPORT WITH_EDITORONLY_DATA
171#endif
172
173// Statestream is WIP and is the system that is going to enable full decoupling of game and render updates
174// Set in .target.cs to enable
175#ifndef WITH_STATE_STREAM
176 #define WITH_STATE_STREAM 0
177#endif
178
179
180/*----------------------------------------------------------------------------
181 Optional bridge options coming from UBT, do not modify directly!
182 If UBT doesn't set the value, it is assumed to be 0, and we set that here.
183----------------------------------------------------------------------------*/
184
191#ifndef CHECK_PUREVIRTUALS
192 #define CHECK_PUREVIRTUALS 0
193#endif
194
196#ifndef USE_NULL_RHI
197 #define USE_NULL_RHI 0
198#endif
199
201#ifndef USE_LOGGING_IN_SHIPPING
202 #define USE_LOGGING_IN_SHIPPING 0
203#endif
204
205#ifndef USE_CHECKS_IN_SHIPPING
206 #define USE_CHECKS_IN_SHIPPING 0
207#endif
208
210#ifndef USE_ENSURES_IN_SHIPPING
211 #define USE_ENSURES_IN_SHIPPING USE_CHECKS_IN_SHIPPING
212#endif
213
214#ifndef ALLOW_CONSOLE_IN_SHIPPING
215 #define ALLOW_CONSOLE_IN_SHIPPING 0
216#endif
217
219#ifndef FORCE_USE_STATS
220 #define FORCE_USE_STATS 0
221#endif
222
224#ifndef FORCE_ANSI_ALLOCATOR
225 #define FORCE_ANSI_ALLOCATOR 0
226#endif
227
228/*--------------------------------------------------------------------------------
229 Basic options that by default depend on the build configuration and platform
230
231 DO_GUARD_SLOW If true, then checkSlow, checkfSlow and verifySlow are compiled into the executable.
232 DO_CHECK If true, then checkCode, checkf, verify, check, checkNoEntry, checkNoReentry, checkNoRecursion, verifyf, checkf are compiled into the executables
233 DO_ENSURE If true, then ensure, ensureAlways, ensureMsgf and ensureAlwaysMsgf are compiled into the executables
234 STATS If true, then the stats system is compiled into the executable.
235 ALLOW_DEBUG_FILES If true, then debug files like screen shots and profiles can be saved from the executable.
236 NO_LOGGING If true, then no logs or text output will be produced
237 ENABLE_STATNAMEDEVENTS If true, then enable support for named events from the stat macros without the stat system overhead. This will attempt to disable regular stats system and use named events instead.
238
239--------------------------------------------------------------------------------*/
240
241#if UE_BUILD_DEBUG
242 #ifndef DO_GUARD_SLOW
243 #define DO_GUARD_SLOW 1
244 #endif
245 #ifndef DO_CHECK
246 #define DO_CHECK 1
247 #endif
248 #ifndef DO_ENSURE
249 #define DO_ENSURE 1
250 #endif
251 #ifndef ENABLE_STATNAMEDEVENTS
252 #define ENABLE_STATNAMEDEVENTS 0
253 #endif
254 #ifndef ENABLE_STATNAMEDEVENTS_UOBJECT
255 #define ENABLE_STATNAMEDEVENTS_UOBJECT 0
256 #endif
257 #ifndef STATS
258 #define STATS ((WITH_UNREAL_DEVELOPER_TOOLS || !WITH_EDITORONLY_DATA || USE_STATS_WITHOUT_ENGINE || FORCE_USE_STATS) && !ENABLE_STATNAMEDEVENTS)
259 #endif
260 #ifndef ALLOW_DEBUG_FILES
261 #define ALLOW_DEBUG_FILES 1
262 #endif
263 #ifndef ALLOW_CONSOLE
264 #define ALLOW_CONSOLE 1
265 #endif
266 #ifndef NO_LOGGING
267 #define NO_LOGGING 0
268 #endif
269#elif UE_BUILD_DEVELOPMENT
270 #ifndef DO_GUARD_SLOW
271 #define DO_GUARD_SLOW 0
272 #endif
273 #ifndef DO_CHECK
274 #define DO_CHECK 1
275 #endif
276 #ifndef DO_ENSURE
277 #define DO_ENSURE 1
278 #endif
279 #ifndef ENABLE_STATNAMEDEVENTS
280 #define ENABLE_STATNAMEDEVENTS 0
281 #endif
282 #ifndef ENABLE_STATNAMEDEVENTS_UOBJECT
283 #define ENABLE_STATNAMEDEVENTS_UOBJECT 0
284 #endif
285 #ifndef STATS
286 #define STATS ((WITH_UNREAL_DEVELOPER_TOOLS || !WITH_EDITORONLY_DATA || USE_STATS_WITHOUT_ENGINE || FORCE_USE_STATS) && !ENABLE_STATNAMEDEVENTS)
287 #endif
288 #ifndef ALLOW_DEBUG_FILES
289 #define ALLOW_DEBUG_FILES 1
290 #endif
291 #ifndef ALLOW_CONSOLE
292 #define ALLOW_CONSOLE 1
293 #endif
294 #ifndef NO_LOGGING
295 #define NO_LOGGING 0
296 #endif
297#elif UE_BUILD_TEST
298 #ifndef DO_GUARD_SLOW
299 #define DO_GUARD_SLOW 0
300 #endif
301 #ifndef DO_CHECK
302 #define DO_CHECK USE_CHECKS_IN_SHIPPING
303 #endif
304 #ifndef DO_ENSURE
305 #define DO_ENSURE USE_ENSURES_IN_SHIPPING
306 #endif
307 #ifndef ENABLE_STATNAMEDEVENTS
308 #define ENABLE_STATNAMEDEVENTS (!FORCE_USE_STATS && !USE_STATS_WITHOUT_ENGINE)
309 #endif
310 #ifndef ENABLE_STATNAMEDEVENTS_UOBJECT
311 #define ENABLE_STATNAMEDEVENTS_UOBJECT (ENABLE_STATNAMEDEVENTS)
312 #endif
313 #ifndef STATS
314 #define STATS (FORCE_USE_STATS && !ENABLE_STATNAMEDEVENTS)
315 #endif
316 #ifndef ALLOW_DEBUG_FILES
317 #define ALLOW_DEBUG_FILES 1
318 #endif
319 #ifndef ALLOW_CONSOLE
320 #define ALLOW_CONSOLE 1
321 #endif
322 #ifndef NO_LOGGING
323 #define NO_LOGGING !USE_LOGGING_IN_SHIPPING
324 #endif
325#elif UE_BUILD_SHIPPING
326 #ifndef DO_GUARD_SLOW
327 #define DO_GUARD_SLOW 0
328 #endif
329 #ifndef DO_CHECK
330 #define DO_CHECK USE_CHECKS_IN_SHIPPING
331 #endif
332 #ifndef DO_ENSURE
333 #define DO_ENSURE USE_ENSURES_IN_SHIPPING
334 #endif
335 #ifndef ENABLE_STATNAMEDEVENTS
336 #define ENABLE_STATNAMEDEVENTS 0
337 #endif
338 #ifndef ENABLE_STATNAMEDEVENTS_UOBJECT
339 #define ENABLE_STATNAMEDEVENTS_UOBJECT 0
340 #endif
341 #ifndef STATS
342 #define STATS (FORCE_USE_STATS && !ENABLE_STATNAMEDEVENTS)
343 #endif
344 #ifndef ALLOW_DEBUG_FILES
345 #define ALLOW_DEBUG_FILES WITH_EDITOR
346 #endif
347 #ifndef ALLOW_CONSOLE
348 #define ALLOW_CONSOLE ALLOW_CONSOLE_IN_SHIPPING
349 #endif
350 #ifndef NO_LOGGING
351 #define NO_LOGGING !USE_LOGGING_IN_SHIPPING
352 #endif
353#else
354 #error Exactly one of [UE_BUILD_DEBUG UE_BUILD_DEVELOPMENT UE_BUILD_TEST UE_BUILD_SHIPPING] should be defined to be 1
355#endif
356
357
372#ifndef LOOKING_FOR_PERF_ISSUES
373 #define LOOKING_FOR_PERF_ISSUES (0 && !(UE_BUILD_SHIPPING))
374#endif
375
377#ifndef USE_NETWORK_PROFILER
378#define USE_NETWORK_PROFILER !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
379#endif
380
382#ifndef VALIDATE_USER_GRAPH_PERSISTENT_FRAME
383 #define VALIDATE_UBER_GRAPH_PERSISTENT_FRAME (!(UE_BUILD_SHIPPING || UE_BUILD_TEST))
384#endif
385
387#ifndef UE_BLUEPRINT_EVENTGRAPH_FASTCALLS
388 #define UE_BLUEPRINT_EVENTGRAPH_FASTCALLS 1
389#endif
390
392#ifndef USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING
393 #define USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING 1
394#endif
395
397#ifndef USE_DEFERRED_DEPENDENCY_CHECK_VERIFICATION_TESTS
398 #define USE_DEFERRED_DEPENDENCY_CHECK_VERIFICATION_TESTS (USE_CIRCULAR_DEPENDENCY_LOAD_DEFERRING && 0)
399#endif
400
401// 0 (default), set this to 1 to get draw events with "TOGGLEDRAWEVENTS" "r.ShowMaterialDrawEvents" and the "ProfileGPU" command working in test
402#ifndef ALLOW_PROFILEGPU_IN_TEST
403 #define ALLOW_PROFILEGPU_IN_TEST 0
404#endif
405
406#ifndef ALLOW_PROFILEGPU_IN_SHIPPING
407 #define ALLOW_PROFILEGPU_IN_SHIPPING 0
408#endif
409
410// draw events with "TOGGLEDRAWEVENTS" "r.ShowMaterialDrawEvents" (for ProfileGPU, Pix, Razor, RenderDoc, ...) and the "ProfileGPU" command are normally compiled out for TEST and SHIPPING
411#define WITH_PROFILEGPU (!(UE_BUILD_SHIPPING || UE_BUILD_TEST) || (UE_BUILD_TEST && ALLOW_PROFILEGPU_IN_TEST) || (UE_BUILD_SHIPPING && ALLOW_PROFILEGPU_IN_SHIPPING))
412
413#ifndef ALLOW_DUMPGPU_IN_TEST
414 #define ALLOW_DUMPGPU_IN_TEST 1
415#endif
416
417#ifndef ALLOW_DUMPGPU_IN_SHIPPING
418 #define ALLOW_DUMPGPU_IN_SHIPPING 0
419#endif
420
421// DumpGPU command
422#define WITH_DUMPGPU (!(UE_BUILD_SHIPPING || UE_BUILD_TEST) || (UE_BUILD_TEST && ALLOW_DUMPGPU_IN_TEST) || (UE_BUILD_SHIPPING && ALLOW_DUMPGPU_IN_SHIPPING))
423
424#ifndef ALLOW_GPUDEBUGCRASH_IN_TEST
425#define ALLOW_GPUDEBUGCRASH_IN_TEST 1
426#endif
427
428#ifndef ALLOW_GPUDEBUGCRASH_IN_SHIPPING
429#define ALLOW_GPUDEBUGCRASH_IN_SHIPPING 0
430#endif
431
432// GPUDebugCrash
433#define WITH_GPUDEBUGCRASH (!(UE_BUILD_SHIPPING || UE_BUILD_TEST) || (UE_BUILD_TEST && ALLOW_GPUDEBUGCRASH_IN_TEST) || (UE_BUILD_SHIPPING && ALLOW_GPUDEBUGCRASH_IN_SHIPPING))
434
435#ifndef ALLOW_CHEAT_CVARS_IN_TEST
436 #define ALLOW_CHEAT_CVARS_IN_TEST 1
437#endif
438
439#ifndef DISABLE_CHEAT_CVARS
440 #define DISABLE_CHEAT_CVARS (UE_BUILD_SHIPPING || (UE_BUILD_TEST && !ALLOW_CHEAT_CVARS_IN_TEST))
441#endif
442
443// Controls the creation of a thread for detecting hangs (FThreadHeartBeat). This is subject to other criteria, USE_HANG_DETECTION
444#ifndef ALLOW_HANG_DETECTION
445 #define ALLOW_HANG_DETECTION 1
446#endif
447#define USE_HANG_DETECTION (ALLOW_HANG_DETECTION && !WITH_EDITORONLY_DATA && !IS_PROGRAM && !UE_BUILD_DEBUG && !ENABLE_PGO_PROFILE && !USING_THREAD_SANITISER && !USING_INSTRUMENTATION)
448
449// Controls the creation of a thread for detecting hitches (FGameThreadHitchHeartBeat). This is subject to other criteria, USE_HITCH_DETECTION
450#ifndef ALLOW_HITCH_DETECTION
451 #define ALLOW_HITCH_DETECTION 0
452#endif
453
454// Adjust a few things with the slack policy and MallocBinned2 to minimize memory usage (at some performance cost)
455#ifndef AGGRESSIVE_MEMORY_SAVING
456 #define AGGRESSIVE_MEMORY_SAVING 0
457#endif
458
459// Controls if UObjects are initialized as soon as they are available or only after the module is "loaded". This only applies to monolithic builds; if there are DLLs, this is how it works anyway and this should not be turned on
460#ifndef USE_PER_MODULE_UOBJECT_BOOTSTRAP
461 #define USE_PER_MODULE_UOBJECT_BOOTSTRAP 0
462#endif
463
464#ifndef USE_HITCH_DETECTION
465 #define USE_HITCH_DETECTION (ALLOW_HITCH_DETECTION && !WITH_EDITORONLY_DATA && !IS_PROGRAM && !UE_BUILD_DEBUG && !USING_THREAD_SANITISER && !USING_INSTRUMENTATION)
466#endif
467
468// Controls whether shipping builds create backups of the most recent log file.
469// All other configurations always create backups.
470#ifndef PRESERVE_LOG_BACKUPS_IN_SHIPPING
471 #define PRESERVE_LOG_BACKUPS_IN_SHIPPING 1
472#endif
473
474#ifndef ENABLE_RHI_VALIDATION
475 #define ENABLE_RHI_VALIDATION (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT)
476#endif
477
478// Controls whether FPlatformMisc::GetDeviceId() is available to be called.
479// When set to 1, calls to this API will be hardcoded to return an empty string
480// to avoid running afoul of calling device APIs that platform owners may restrict
481// access to without waivers or special steps. Code that uses GetDeviceId() should
482// expect to receive empty strings in these cases and response appropriately with
483// fallback logic.
484#ifndef GET_DEVICE_ID_UNAVAILABLE
485 #define GET_DEVICE_ID_UNAVAILABLE 0
486#endif
487
488// Controls whether the executable is compiled with cooked editor functionality
489#ifndef UE_IS_COOKED_EDITOR
490#define UE_IS_COOKED_EDITOR 0
491#endif
492// Controls whether to enable loading cooked packages from I/O store in editor builds. Defaults to WITH_EDITOR as we can now
493// load from IoStore without needing to stage an entire cooked build
494#ifndef WITH_IOSTORE_IN_EDITOR
495#define WITH_IOSTORE_IN_EDITOR WITH_EDITOR
496#endif
497
498// Controls if iostore will be forced on
499#ifndef UE_FORCE_USE_IOSTORE
500#define UE_FORCE_USE_IOSTORE 0
501#endif
502
503// Controls if paks will be forced on unless -NoPaks argument is passed
504#ifndef UE_FORCE_USE_PAKS
505#define UE_FORCE_USE_PAKS 0
506#endif
507
508
509// Controls whether Iris networking code is compiled in or not; should normally be defined by UBT
510#ifndef UE_WITH_IRIS
511 #define UE_WITH_IRIS 0
512#endif
513
514// Controls whether or not to make a global object to load COnfig.bin as soon as possible
515#ifndef PRELOAD_BINARY_CONFIG
516 #define PRELOAD_BINARY_CONFIG 1
517#endif
518
519#ifndef WITH_COTF
520 #define WITH_COTF ((WITH_ENGINE) && !(IS_PROGRAM || UE_BUILD_SHIPPING))
521#endif
522
523// Controls if the config system can stores configs for other platforms than the running one
524#ifndef ALLOW_OTHER_PLATFORM_CONFIG
525#define ALLOW_OTHER_PLATFORM_CONFIG WITH_UNREAL_DEVELOPER_TOOLS
526#endif
527
528// Controls whether or not process will control OS scheduler priority
529#ifndef WITH_PROCESS_PRIORITY_CONTROL
530 #define WITH_PROCESS_PRIORITY_CONTROL 0
531#endif
532
533// A compile time flag used to enable support for disabling actor ticking and calls to user callbacks.
534// This functionality is not intended for general use and should be used with care.
535#ifndef UE_SUPPORT_FOR_ACTOR_TICK_DISABLE
536 #define UE_SUPPORT_FOR_ACTOR_TICK_DISABLE 0
537#endif