Skip to content

Commit a2771ce

Browse files
committed
[RN][iOS] Fix flags
1 parent d2ac5d6 commit a2771ce

File tree

1 file changed

+4
-3
lines changed
  • packages/react-native/scripts/cocoapods

1 file changed

+4
-3
lines changed

packages/react-native/scripts/cocoapods/utils.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def self.apply_xcode_15_patch(installer, xcodebuild_manager: Xcodebuild)
162162
project.build_configurations.each do |config|
163163
# fix for weak linking
164164
self.safe_init(config, other_ld_flags_key)
165-
if self.is_using_xcode15_or_greater(:xcodebuild_manager => xcodebuild_manager)
165+
if self.is_using_xcode15_0(:xcodebuild_manager => xcodebuild_manager)
166166
self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
167167
else
168168
self.remove_value_to_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
@@ -387,7 +387,7 @@ def self.remove_value_to_setting_if_present(config, setting_name, value)
387387
end
388388
end
389389

390-
def self.is_using_xcode15_or_greater(xcodebuild_manager: Xcodebuild)
390+
def self.is_using_xcode15_0(xcodebuild_manager: Xcodebuild)
391391
xcodebuild_version = xcodebuild_manager.version
392392

393393
# The output of xcodebuild -version is something like
@@ -398,7 +398,8 @@ def self.is_using_xcode15_or_greater(xcodebuild_manager: Xcodebuild)
398398
regex = /(\d+)\.(\d+)(?:\.(\d+))?/
399399
if match_data = xcodebuild_version.match(regex)
400400
major = match_data[1].to_i
401-
return major >= 15
401+
minor = match_data[2].to_i
402+
return major == 15 && minor == 0
402403
end
403404

404405
return false

0 commit comments

Comments
 (0)