Commit a763a69
Fix the Redefinition of 'NativeXXXSpecJSI' error with Frameworks (#44005)
Summary:
When using frameworks on iOS, there is a possibility that modules import the Spec.h file twice and this might end up in a Redefinition of some symbols and duplication of symbols which ends up in build errors, as reported here: #42670.
This change adds some [`#include guards`](https://en.wikipedia.org/wiki/Include_guard) in codegen to avoid the redefinition of those symbols if the header is imported/included multiple times.
Note: I also experimented with `#pragma once`, but it looks like Apple is not happy with that directive. [It seems](https://forums.developer.apple.com/forums/thread/739964) that it started working flakely from Xcode 15.
## Changelog:
[General][Fixed] - Make sure that we can't include Codegen symbols multiple times
Differential Revision: D559256051 parent 403bbae commit a763a69
3 files changed
Lines changed: 166 additions & 18 deletions
File tree
- packages/react-native-codegen
- e2e/__tests__/modules/__snapshots__
- src/generators/modules
- GenerateModuleObjCpp
- __tests__/__snapshots__
0 commit comments