@@ -179,20 +179,13 @@ private static void RunPostBuildScript(BuildTarget target, string projectPath =
179
179
Debug . Log ( "[Adjust]: Skipping AppTrackingTransparency.framework linking." ) ;
180
180
}
181
181
182
- // The Adjust SDK needs to have Obj-C exceptions enabled.
183
- // GCC_ENABLE_OBJC_EXCEPTIONS=YES
184
- Debug . Log ( "[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES." ) ;
185
- xcodeProject . AddBuildProperty ( xcodeTarget , "GCC_ENABLE_OBJC_EXCEPTIONS" , "YES" ) ;
186
- Debug . Log ( "[Adjust]: Obj-C exceptions enabled successfully." ) ;
187
-
188
182
// The Adjust SDK needs to have -ObjC flag set in other linker flags section because of it's categories.
189
183
// OTHER_LDFLAGS -ObjC
190
184
//
191
185
// Seems that in newer Unity IDE versions adding -ObjC flag to Unity-iPhone target doesn't do the trick.
192
186
// Adding -ObjC to UnityFramework target however does make things work nicely again.
193
187
// This happens because Unity is linking SDK's static library into UnityFramework target.
194
188
// Check for presence of UnityFramework target and if there, include -ObjC flag inside of it.
195
-
196
189
Debug . Log ( "[Adjust]: Adding -ObjC flag to other linker flags (OTHER_LDFLAGS) of Unity-iPhone target." ) ;
197
190
xcodeProject . AddBuildProperty ( xcodeTarget , "OTHER_LDFLAGS" , "-ObjC" ) ;
198
191
Debug . Log ( "[Adjust]: -ObjC successfully added to other linker flags." ) ;
@@ -204,6 +197,18 @@ private static void RunPostBuildScript(BuildTarget target, string projectPath =
204
197
Debug . Log ( "[Adjust]: -ObjC successfully added to other linker flags." ) ;
205
198
}
206
199
200
+ // The Adjust SDK needs to have Obj-C exceptions enabled.
201
+ // GCC_ENABLE_OBJC_EXCEPTIONS=YES
202
+ Debug . Log ( "[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES." ) ;
203
+ xcodeProject . AddBuildProperty ( xcodeTarget , "GCC_ENABLE_OBJC_EXCEPTIONS" , "YES" ) ;
204
+ Debug . Log ( "[Adjust]: Obj-C exceptions enabled successfully." ) ;
205
+ if ( ! string . IsNullOrEmpty ( xcodeTargetUnityFramework ) )
206
+ {
207
+ Debug . Log ( "[Adjust]: Enabling Obj-C exceptions by setting GCC_ENABLE_OBJC_EXCEPTIONS value to YES." ) ;
208
+ xcodeProject . AddBuildProperty ( xcodeTargetUnityFramework , "GCC_ENABLE_OBJC_EXCEPTIONS" , "YES" ) ;
209
+ Debug . Log ( "[Adjust]: Obj-C exceptions enabled successfully." ) ;
210
+ }
211
+
207
212
if ( xcodeProject . ContainsFileByProjectPath ( "Libraries/Adjust/iOS/AdjustSigSdk.a" ) )
208
213
{
209
214
if ( ! string . IsNullOrEmpty ( xcodeTargetUnityFramework ) )
0 commit comments