-
Notifications
You must be signed in to change notification settings - Fork 645
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static Hermes for React Native (#1566)
Summary: X-link: facebook/react-native#48327 This PR introduces necessary changes to let React Native uses latest version of static Hermes. ## Explanation ### Part 1 ```cmake append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) ``` It seems like this flag doesn’t exist anymore in the MSVC 16 compiler. CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004 ``` fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2' ``` ### Part 2 ```cmake if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") # MSVC needs C++20 set(CMAKE_CXX_STANDARD 20) else() set(CMAKE_CXX_STANDARD 17) endif() ``` Some of the new syntax in static Hermes requires the newer C++ standard on MSVC. ### Part 3 ```cmake # Changes in lib/CMakeLists.txt ``` These updates are necessary to successfully build the Hermes Framework for iOS. ### Part 4 ```diff namespace hermes { namespace hbc { namespace { class BytecodeSerializer { - friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>( + friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>( ``` Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition. Pull Request resolved: #1566 Test Plan: Build RNTester app from here - https://github.com/piaskowyk/react-native/tree/%40piaskowyk/build-static-hermes Reviewed By: tmikov, cipolleschi Differential Revision: D67316013 Pulled By: neildhar fbshipit-source-id: cf03850f94a75acd827b68794700a8f143a90e09
- Loading branch information
1 parent
c09f350
commit ecfdb2f
Showing
7 changed files
with
57 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters