Skip to content

Commit

Permalink
Fix LLDB with internal pod
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmorin committed Aug 22, 2022
1 parent f8462e5 commit dc4688a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
25 changes: 25 additions & 0 deletions AppWithInternalPod/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,28 @@ target 'App' do

pod 'InternalPod', path: 'InternalPod/'
end

post_integrate do |installer|
xcconfig_path = installer.sandbox.target_support_files_root.to_s + '/Pods-App/Pods-App.debug.xcconfig'

xcconfig_content = File.read xcconfig_path
xcconfig_original_ld_flags = xcconfig_content.match(/OTHER_LDFLAGS = ([^\n]+)\n/)[1]

xcconfig_new_ld_flags = <<~CONTENT

// Xcode 13.3+
OTHER_LDFLAGS = #{xcconfig_original_ld_flags} -Wl,-add_ast_path,$(TARGET_BUILD_DIR)/InternalPod/InternalPod.framework/Modules/InternalPod.swiftmodule/$(NATIVE_ARCH_ACTUAL)-apple-$(SHALLOW_BUNDLE_TRIPLE).swiftmodule

// Xcode 13.2
OTHER_LDFLAGS[sdk=iphoneos15.2] = #{xcconfig_original_ld_flags} -Wl,-add_ast_path,$(TARGET_BUILD_DIR)/InternalPod/InternalPod.framework/Modules/InternalPod.swiftmodule/$(NATIVE_ARCH_ACTUAL)-apple-ios.swiftmodule
OTHER_LDFLAGS[sdk=iphonesimulator15.2] = #{xcconfig_original_ld_flags} -Wl,-add_ast_path,$(TARGET_BUILD_DIR)/InternalPod/InternalPod.framework/Modules/InternalPod.swiftmodule/$(NATIVE_ARCH_ACTUAL)-apple-simulator.swiftmodule

CONTENT

xcconfig_content.gsub! /OTHER_LDFLAGS = ([^\n]+)\n/, xcconfig_new_ld_flags

File.open(xcconfig_path, 'w') do |f|
f.puts xcconfig_content
end

end
2 changes: 1 addition & 1 deletion AppWithInternalPod/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
InternalPod: 6c25dd2d44a76cb1b349b4694da89b773b8e6005

PODFILE CHECKSUM: 3c5c876b369ef0b36860b65f7f1142c32f433e2e
PODFILE CHECKSUM: 6ff34f495d16738b36ddb1943c48ed7d3d552904

COCOAPODS: 1.11.3
2 changes: 1 addition & 1 deletion AppWithInternalPod/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dc4688a

Please sign in to comment.