From 6c75dea61b1e0c38ef77036dffa15fb845ef0b16 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Wed, 14 Sep 2022 20:39:34 +0200 Subject: [PATCH] fix: keep previously set IL2CPP compiler arguments (i.e append instead of overwriting) (#972) --- CHANGELOG.md | 1 + src/Sentry.Unity.Editor/Il2CppOption.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 075d08d23..eb235d897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixes - Don't access Unity `AnalyticsSessionInfo.userId` on unknown platforms ([#971](https://github.com/getsentry/sentry-unity/pull/971)) +- Keep previously set IL2CPP compiler arguments (i.e append instead of overwriting) ([#972](https://github.com/getsentry/sentry-unity/pull/972)) ### Dependencies diff --git a/src/Sentry.Unity.Editor/Il2CppOption.cs b/src/Sentry.Unity.Editor/Il2CppOption.cs index 15c698652..f67cc70e0 100644 --- a/src/Sentry.Unity.Editor/Il2CppOption.cs +++ b/src/Sentry.Unity.Editor/Il2CppOption.cs @@ -12,8 +12,8 @@ internal class Il2CppOption : IPreprocessBuildWithReport public void OnPreprocessBuild(BuildReport report) { var arguments = "--emit-source-mapping"; - Debug.Log($"Setting additional IL2CPP arguments = '{arguments}' for platform {report.summary.platform}"); - PlayerSettings.SetAdditionalIl2CppArgs(arguments); + Debug.Log($"Setting additional IL2CPP arguments '{arguments}' for platform {report.summary.platform}"); + PlayerSettings.SetAdditionalIl2CppArgs(PlayerSettings.GetAdditionalIl2CppArgs() + $" {arguments}"); } } }