diff --git a/Example/ios/Podfile b/Example/ios/Podfile index e516c25669..92ca667e99 100644 --- a/Example/ios/Podfile +++ b/Example/ios/Podfile @@ -58,5 +58,19 @@ target 'ScreensExample' do :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + projects = installer.aggregate_targets + .map{ |t| t.user_project } + .uniq{ |p| p.path } + should_use_classic_linker = File.exist?(File.join(`xcode-select -p`.strip, 'Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic')) + projects.each do |project| + if should_use_classic_linker + Pod::UI.puts("Applying flags '-Wl -ld_classic' for Xcode 15 on #{ project.path }") + project.build_configurations.each do |config| + config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -Wl -ld_classic' + end + project.save() + end + end end end diff --git a/FabricExample/ios/Podfile b/FabricExample/ios/Podfile index dacb08c424..b0490cecfb 100644 --- a/FabricExample/ios/Podfile +++ b/FabricExample/ios/Podfile @@ -60,5 +60,19 @@ target 'FabricExample' do :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + projects = installer.aggregate_targets + .map{ |t| t.user_project } + .uniq{ |p| p.path } + should_use_classic_linker = File.exist?(File.join(`xcode-select -p`.strip, 'Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic')) + projects.each do |project| + if should_use_classic_linker + Pod::UI.puts("Applying flags '-Wl -ld_classic' for Xcode 15 on #{ project.path }") + project.build_configurations.each do |config| + config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -Wl -ld_classic' + end + project.save() + end + end end end diff --git a/FabricTestExample/ios/Podfile b/FabricTestExample/ios/Podfile index 5ac2e045fe..0148410114 100644 --- a/FabricTestExample/ios/Podfile +++ b/FabricTestExample/ios/Podfile @@ -60,5 +60,19 @@ target 'FabricTestExample' do :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + projects = installer.aggregate_targets + .map{ |t| t.user_project } + .uniq{ |p| p.path } + should_use_classic_linker = File.exist?(File.join(`xcode-select -p`.strip, 'Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic')) + projects.each do |project| + if should_use_classic_linker + Pod::UI.puts("Applying flags '-Wl -ld_classic' for Xcode 15 on #{ project.path }") + project.build_configurations.each do |config| + config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -Wl -ld_classic' + end + project.save() + end + end end end diff --git a/TestsExample/ios/Podfile b/TestsExample/ios/Podfile index 86619cb3cb..555210263c 100644 --- a/TestsExample/ios/Podfile +++ b/TestsExample/ios/Podfile @@ -58,5 +58,19 @@ target 'TestsExample' do :mac_catalyst_enabled => false ) __apply_Xcode_12_5_M1_post_install_workaround(installer) + + projects = installer.aggregate_targets + .map{ |t| t.user_project } + .uniq{ |p| p.path } + should_use_classic_linker = File.exist?(File.join(`xcode-select -p`.strip, 'Toolchains/XcodeDefault.xctoolchain/usr/bin/ld-classic')) + projects.each do |project| + if should_use_classic_linker + Pod::UI.puts("Applying flags '-Wl -ld_classic' for Xcode 15 on #{ project.path }") + project.build_configurations.each do |config| + config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -Wl -ld_classic' + end + project.save() + end + end end end