[Infra] Only compile core extension headers once #13993
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.

A custom module map was too difficult. I couldn't get CocoaPods to respect the custom module map and stopped when I started to spin on things. I switched to guarding the headers against being included twice. It seems promising so far. I also tried with using
#pragma oncebut that didn't work because (my guess) is that the problem is not that the same header is being included twice, it's that two different headers with the same content are both being included (once in FirebaseCore and once in FirebaseCoreExtension).Test cases and their results below:
FirebaseCorespec butFirebaseCoreExtension@ main. The framework target builds but the docs target does not build because of theFirebaseCoreExtension@ main does not have guarded headers.FirebaseCorespec AND updatedFirebaseCoreExtensionspec. The framework target builds AND the docs target builds.FirebaseCore(the floating case). The framework target builds but the docs target does not build because of using theFirebaseCoreExtension@ main.FirebaseCore(the floating case). In this example, it floats to pick up FirebaseCoreExtension as well. The framework target builds and the docs target builds.