310 Commits

Author SHA1 Message Date
joe kirchoff
094968df3d UnrealBuildTool: Support ISPC multiple architectures in a single build
* Update GenerateISPCHeaders & CompileISPCFiles to work the same as CompileCppFiles, handling multiple arch
* GenerateISPCHeaders & CompileISPCFiles is now protected
* Simplify platform and arch logic in ISPCToolchain
* Remove need to override ISPC compile functions for Android

[CL 36038490 by joe kirchoff in ue5-main branch]
2024-09-05 10:06:13 -04:00
julian gamble
67ba4d64cc bEnableNoInlinedWarnings=true causes crash under specific module fileset
#jira UES-7489
#rb Joe.Kirchoff

[CL 35730562 by julian gamble in ue5-main branch]
2024-08-21 22:56:07 -04:00
michael nicolella
63b981f08b ubt: added build options for enabling the autortfm verifier
#rb Joe.Kirchoff, neil.henning

[CL 35550129 by michael nicolella in ue5-main branch]
2024-08-14 17:27:14 -04:00
joe kirchoff
6ce78d5a7e UnrealBuildTool: Clarify error when a precompiled build references a module that isn available
#rnx
#jira UE-219484

[CL 35346039 by joe kirchoff in ue5-main branch]
2024-08-06 13:29:01 -04:00
ben clayton
c84087525f [AutoRTFM] Prevent premature inlining of RTFM core functions and prevent mixed -fautortfm PCHs
The compiler can inline function calls before the AutoRTFMCompilerPass splits functions into open and closed variants, which can lead to incorrect RTFM behaviour.

When AutoRTFM is enabled (clang-verse with -fautortfm) remove the implementation of autortfm_is_closed(). This prevents the compiler from inlining the function (as there is nothing to inline).

Replace the use of UE_AUTORTFM_AUTORTFM() with function bodies that explicitly branches on autortfm_is_closed(), calling either a UE_AUTORTFM_ALWAYS_OPEN annotated closed function, or instead performing the open logic. Because the function body calls autortfm_is_closed() (which cannot be inlined), these functions should avoid the premature inlining problem.

When AutoRTFM is not enabled (clang-verse with -fautortfm, or a different compiler) the AutoRTFM core functions are stubbed with `static inline` implementations. The static qualifier should be sufficient to prevent this implementation leaking into other modules with AutoRTFM enabled.

Change BENIGN_LANGOPT(AutoRTFM, ...) to LANGOPT(AutoRTFM, ...). This makes Clang consider the flag as incompatible when mixing -fautortfm / no -fautortfm between precompiled headers and users. This is important as the new __AUTORTFM_ENABLED macro will be baked into the PCH.

Error if both -fautortfm and exceptions are enabled on the compiler.

Update the UnrealBuildTool to separate PCHs with -fautortfm enabled and without.

#rb neil.henning

[CL 35333537 by ben clayton in ue5-main branch]
2024-08-06 03:10:51 -04:00
justin peterson
bc46511751 [Backout] - CL35058919 - Build Compile Error
[FYI] ben.clayton
Original CL Desc
-----------------------------------------------------------------
[AutoRTFM] Prevent premature inlining of RTFM core functions and prevent mixed -fautortfm PCHs

The compiler can inline function calls before the AutoRTFMCompilerPass splits functions into open and closed variants, which can lead to incorrect RTFM behaviour.

When AutoRTFM is enabled (clang-verse with -fautortfm) remove the implementation of autortfm_is_closed(). This prevents the compiler from inlining the function (as there is nothing to inline).

Replace the use of UE_AUTORTFM_AUTORTFM() with function bodies that explicitly branches on autortfm_is_closed(), calling either a UE_AUTORTFM_ALWAYS_OPEN annotated closed function, or instead performing the open logic. Because the function body calls autortfm_is_closed() (which cannot be inlined), these functions should avoid the premature inlining problem.

When AutoRTFM is not enabled (clang-verse with -fautortfm, or a different compiler) the AutoRTFM core functions are stubbed with `static inline` implementations. The static qualifier should be sufficient to prevent this implementation leaking into other modules with AutoRTFM enabled.

Change BENIGN_LANGOPT(AutoRTFM, ...) to LANGOPT(AutoRTFM, ...). This makes Clang consider the flag as incompatible when mixing -fautortfm / no -fautortfm between precompiled headers and users. This is important as the new __AUTORTFM_ENABLED macro will be baked into the PCH.

Update the UnrealBuildTool to separate PCHs with -fautortfm enabled and without.

#rb michael.nicolella

[CL 35070269 by justin peterson in ue5-main branch]
2024-07-24 18:29:18 -04:00
ben clayton
1b0c134313 [AutoRTFM] Prevent premature inlining of RTFM core functions and prevent mixed -fautortfm PCHs
The compiler can inline function calls before the AutoRTFMCompilerPass splits functions into open and closed variants, which can lead to incorrect RTFM behaviour.

When AutoRTFM is enabled (clang-verse with -fautortfm) remove the implementation of autortfm_is_closed(). This prevents the compiler from inlining the function (as there is nothing to inline).

Replace the use of UE_AUTORTFM_AUTORTFM() with function bodies that explicitly branches on autortfm_is_closed(), calling either a UE_AUTORTFM_ALWAYS_OPEN annotated closed function, or instead performing the open logic. Because the function body calls autortfm_is_closed() (which cannot be inlined), these functions should avoid the premature inlining problem.

When AutoRTFM is not enabled (clang-verse with -fautortfm, or a different compiler) the AutoRTFM core functions are stubbed with `static inline` implementations. The static qualifier should be sufficient to prevent this implementation leaking into other modules with AutoRTFM enabled.

Change BENIGN_LANGOPT(AutoRTFM, ...) to LANGOPT(AutoRTFM, ...). This makes Clang consider the flag as incompatible when mixing -fautortfm / no -fautortfm between precompiled headers and users. This is important as the new __AUTORTFM_ENABLED macro will be baked into the PCH.

Update the UnrealBuildTool to separate PCHs with -fautortfm enabled and without.

#rb michael.nicolella

[CL 35058925 by ben clayton in ue5-main branch]
2024-07-24 13:22:12 -04:00
joe kirchoff
33089071ef UnralBuildTool: Fixing more analysis warnings
#rnx

[CL 35042727 by joe kirchoff in ue5-main branch]
2024-07-23 19:39:24 -04:00
Tim Smith
69bc34ebc6 Adding UE support for custom generated code to be compiled similar to default generated code.
This is done via new exporter option called CompileOutput.

#rb Tim.Smith
#jira none

[CL 34904497 by Tim Smith in ue5-main branch]
2024-07-18 12:45:42 -04:00
joe kirchoff
2789a37c08 UnrealBuildTool: Allow for ForceIncludeFiles to be set in ModuleRules
#rnx

[CL 34658944 by joe kirchoff in ue5-main branch]
2024-06-25 17:57:44 -04:00
brandon schaefer
22596fd074 Use Joe.K change to use ForceNoAutoRTFMCompiler in the Get of bUseAutoRTFMCompiler
#rb ted.percival

[CL 34572441 by brandon schaefer in ue5-main branch]
2024-06-21 15:17:59 -04:00
joe kirchoff
0c9cf7e3ba UnrealBuildTool: Improve missing precompiled module error
#rnx
#jira UE-206558

[CL 34548117 by joe kirchoff in ue5-main branch]
2024-06-20 18:00:40 -04:00
joe kirchoff
761ea07fa2 UnrealBuildTool: Use warning level for undefined identifier property
#rnx
#jira UE-200408

[CL 34534901 by joe kirchoff in ue5-main branch]
2024-06-20 13:13:35 -04:00
brandon schaefer
d26b225a62 Make a force disable AutoRTFM bool
#rb Brandon.Schaefer

[CL 34383045 by brandon schaefer in ue5-main branch]
2024-06-14 16:25:01 -04:00
joe kirchoff
851687444c UnrealBuildTool: Error earlier if there are duplicate named source files in a module, as this will cause intermediate file conflicts in NonUnity builds
#rnx
#jira UE-215018

[CL 34252414 by joe kirchoff in ue5-main branch]
2024-06-10 16:33:57 -04:00
joe kirchoff
e4db99b42d UnrealBuildTool: Fix logic for disabling SharedPCH for cpp17 modules
#rnx

[CL 34023196 by joe kirchoff in ue5-main branch]
2024-05-30 20:20:48 -04:00
brandon schaefer
98b4996b7e Remove bAllowAutoRTFM in favor of bDisableAutoRTFM, so by default we will always enable AutoRTFM for module if using AutoRTFM compiler unless the module disables it
[CL 34015078 by brandon schaefer in ue5-main branch]
2024-05-30 18:01:07 -04:00
brandon schaefer
6d609fcb13 Support moving to disabling AutoRTFM support only vs explicitly enabling
#rb Neil.Henning

[CL 34014580 by brandon schaefer in ue5-main branch]
2024-05-30 17:47:55 -04:00
joe kirchoff
4901d933ec UnrealBuildTool: Allow disabling specific PVS analyzer errors for modules
#rnx

[CL 33897774 by joe kirchoff in ue5-main branch]
2024-05-24 12:38:56 -04:00
marc audy
38a8d9fdfc Remove the Platform.h experiment as it fails if files are in modules that don't include Core and put back the one off pragma disable for the single file cases in to DirectHeaderCompiling.h, leaving the global case in place for most use cases
#rnx

[CL 33806551 by marc audy in ue5-main branch]
2024-05-21 15:49:19 -04:00
marc audy
94f319872d Globally disable C5105 instead of just for direct header including
Include Platform.h before doing a single file header include (to set up the compiler correctly)
#rnx

[CL 33803971 by marc audy in ue5-main branch]
2024-05-21 14:42:39 -04:00
marc audy
5a0718a314 direct header compiling tools
#rb christopher.waters

[CL 33798962 by marc audy in ue5-main branch]
2024-05-21 12:23:35 -04:00
henrik karlsson
d420d28a78 [UBT]
* Fixed so PerModule cpp file creates its own translation unit if module merging is enabled
* Fixed so only one translation unit of PerModule.cpp is added per binary if module merging is enabled

[CL 33735442 by henrik karlsson in ue5-main branch]
2024-05-17 16:08:18 -04:00
henrik karlsson
b250c11229 Changed so operator new/delete overloads are pulled in through a special include compiled in a generated cpp file that goes in its own translation unit. This will make it possible to support merging of modules and only include one of the .obj files for these overloads
If a module depends on Core and does not want the overloads it needs to add the private define SUPPRESS_PER_MODULE_INLINE_FILE or set PER_MODULE_INLINE_FILE to point to a different file

[CL 33709297 by henrik karlsson in ue5-main branch]
2024-05-16 22:34:40 -04:00
joe kirchoff
f778f524de UnrealBuildTool: Preprocess SharedPCH when generating project files to prevent writing to the same file multiple times
#rnx
#jira UE-213872

[CL 33690581 by joe kirchoff in ue5-main branch]
2024-05-16 12:21:10 -04:00