Skip to content

Commit

Permalink
Fix xbox, add xbox one support and build backtrace option
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaDev5 committed Dec 19, 2024
1 parent 81d74c5 commit c5bea5e
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions plugin-dev/Source/Sentry/Sentry.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,14 @@ private string CreateCMakeConfigCommand(ReadOnlyTargetRules target, ModuleRules
options=" -T host=x64";
}

string buildStatic = "";
if (rules.PublicDefinitions.Contains("USE_SENTRY_BREAKPAD=1"))
{
options += " -DSENTRY_BACKEND=breakpad";
}

if (rules.PublicDefinitions.Contains("SENTRY_BUILD_STATIC=1"))
{
buildStatic = "-DSENTRY_BUILD_SHARED_LIBS=ON";
options += " -DSENTRY_BUILD_SHARED_LIBS=ON";
}

string cmakeFile = Path.Combine(m_generatedTargetPath, "CMakeLists.txt");
Expand All @@ -327,7 +331,6 @@ private string CreateCMakeConfigCommand(ReadOnlyTargetRules target, ModuleRules
buildToolchain+
" -DCMAKE_BUILD_TYPE="+GetBuildType(target)+
" -DCMAKE_INSTALL_PREFIX=\""+installPath+"\""+
buildStatic+
options+
" "+m_cmakeArgs;

Expand Down Expand Up @@ -411,6 +414,9 @@ private bool IsUnixPlatform(UnrealTargetPlatform platform) {

public class Sentry : ModuleRules
{
[CommandLine("-usebreakpad")]
public bool bUseBreakpad = false;

public Sentry(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
Expand Down Expand Up @@ -458,8 +464,10 @@ public Sentry(ReadOnlyTargetRules Target) : base(Target)
}
);

UnrealTargetPlatform XboxPlatform;
UnrealTargetPlatform.TryParse("Xbox", out XboxPlatform);
UnrealTargetPlatform XboxXPlatform;
UnrealTargetPlatform.TryParse("XSX", out XboxXPlatform);
UnrealTargetPlatform XboxOnePlatform;
UnrealTargetPlatform.TryParse("XB1", out XboxOnePlatform);

if (Target.Platform == UnrealTargetPlatform.IOS)
{
Expand All @@ -484,6 +492,11 @@ public Sentry(ReadOnlyTargetRules Target) : base(Target)

PublicDefinitions.Add("USE_SENTRY_NATIVE=1");
PublicDefinitions.Add("SENTRY_BUILD_STATIC=1");

if (bUseBreakpad)
{
PublicDefinitions.Add("USE_SENTRY_BREAKPAD=1");
}
}
#if UE_5_0_OR_LATER
else if (Target.Platform == UnrealTargetPlatform.Linux || Target.Platform == UnrealTargetPlatform.LinuxArm64)
Expand All @@ -504,7 +517,7 @@ public Sentry(ReadOnlyTargetRules Target) : base(Target)
PublicDefinitions.Add("COCOAPODS=0");
PublicDefinitions.Add("SENTRY_NO_UIKIT=1");
}
else if (Target.Platform == XboxPlatform)
else if (Target.Platform == XboxXPlatform || Target.Platform == XboxOnePlatform)
{
// Note: We may need a new xbox platform include
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private", "Desktop"));
Expand Down Expand Up @@ -559,7 +572,7 @@ public Sentry(ReadOnlyTargetRules Target) : base(Target)
PublicAdditionalLibraries.Add(Path.Combine(buildPath, "Release", "sentry.a"));
}
}
else if (Target.Platform == XboxPlatform)
else if (Target.Platform == XboxXPlatform || Target.Platform == XboxOnePlatform)
{
string buildPath = Path.Combine(intermediatePath, "Xbox", "build");
if(Target.Configuration == UnrealTargetConfiguration.Debug)
Expand Down

0 comments on commit c5bea5e

Please sign in to comment.