Commit 269e690
fix(worklets): avoid HERMES_V1_ENABLED macro redefinition on RN 0.84+ (#8908)
## Summary
React Native 0.84 centralized the `HERMES_V1_ENABLED` define into
`target_compile_reactnative_options()` in `react-native-flags.cmake`
([commit](facebook/react-native@9f7f6b7)).
When worklets defines `-DHERMES_V1_ENABLED=${HERMES_V1_ENABLED}` and
then calls `target_compile_reactnative_options()`, the macro gets
defined twice with different values (`true` vs `1`), causing:
```
error: 'HERMES_V1_ENABLED' macro redefined [-Werror,-Wmacro-redefined]
#define HERMES_V1_ENABLED true
<command line>:1:9: note: previous definition is here
#define HERMES_V1_ENABLED 1
```
Requires
- #8909
## Solution
Only define `HERMES_V1_ENABLED` manually for RN < 84, since RN 84+
handles it via `target_compile_reactnative_options()`.
## Test plan
- Tested with Expo SDK 55 canary + React Native 0.84.0-rc.4
- Android build succeeds after this fix
---------
Co-authored-by: Tomasz Żelawski <tzelawski@gmail.com>
Co-authored-by: Tomasz Żelawski <40713406+tjzel@users.noreply.github.com>1 parent 9316e8a commit 269e690
File tree
2 files changed
+23
-5
lines changed- packages/react-native-worklets/android
2 files changed
+23
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| |||
112 | 125 | | |
113 | 126 | | |
114 | 127 | | |
115 | | - | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
| |||
284 | 297 | | |
285 | 298 | | |
286 | 299 | | |
287 | | - | |
| 300 | + | |
288 | 301 | | |
289 | 302 | | |
290 | 303 | | |
| |||
0 commit comments