Do not use --pic for modular builds on any Microsoft-based platforms, not just Windows.

#jira UE-151434
#rnx
#rb Nuno.Leiria
#preflight 627d3c1d332e182a583f8db4

[CL 20166726 by David Harvey in ue5-main branch]
This commit is contained in:
David Harvey
2022-05-12 13:01:43 -04:00
parent 870ecb4a90
commit 2847488f33

View File

@@ -383,10 +383,10 @@ namespace UnrealBuildTool
Arguments.Add(String.Format("--cpu={0}", CpuTarget));
}
// PIC is needed for modular builds except on Windows
// PIC is needed for modular builds except on Microsoft platforms
if ((CompileEnvironment.bIsBuildingDLL ||
CompileEnvironment.bIsBuildingLibrary) &&
!UEBuildPlatform.IsPlatformInGroup(CompileEnvironment.Platform, UnrealPlatformGroup.Windows))
!UEBuildPlatform.IsPlatformInGroup(CompileEnvironment.Platform, UnrealPlatformGroup.Microsoft))
{
Arguments.Add("--pic");
}
@@ -588,10 +588,10 @@ namespace UnrealBuildTool
Arguments.Add("-O2");
}
// PIC is needed for modular builds except on Windows
// PIC is needed for modular builds except on Microsoft platforms
if ((CompileEnvironment.bIsBuildingDLL ||
CompileEnvironment.bIsBuildingLibrary) &&
!UEBuildPlatform.IsPlatformInGroup(CompileEnvironment.Platform, UnrealPlatformGroup.Windows))
!UEBuildPlatform.IsPlatformInGroup(CompileEnvironment.Platform, UnrealPlatformGroup.Microsoft))
{
Arguments.Add("--pic");
}