Skip to content

Commit

Permalink
DRAFT: Use reference Yoga CMake build for libyogacore (microsoft#1291)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/yoga#1291

Pull Request resolved: facebook#37371

**Draft:** This is a draft change that I cannot make a draft in Phabricator because I want to export it to GitHub.

This makes React Native use `libyogacore` as provided by Yoga's reference CMake build. This in turn matches Yoga in the OSS RN build to the same compilation settings we use internally. It also means less differences between all the builds (maintainability win).

This does not yet do the same for the Yoga JNI bindings.˜˜

Changelog:
[Android][Changed] - Use reference Yoga CMake Build

Differential Revision: D45764537

fbshipit-source-id: 6a2454c0c211745137ee8eada78704b24e6f93a3
  • Loading branch information
NickGerleman authored and facebook-github-bot committed May 11, 2023
1 parent 7fb2d53 commit 4197691
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
18 changes: 5 additions & 13 deletions packages/react-native/ReactCommon/yoga/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@
cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

add_compile_options(
-fexceptions
-frtti
-O3
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments)
# Yoga by default does not enable optimizations in debug builds. Enable -O2
# for all builds in RN for faster debug app performance (at the cost of not
# being able to debug inside Yoga)
set(CMAKE_BUILD_TYPE Release)

file(GLOB_RECURSE yogacore_SRC CONFIGURE_DEPENDS yoga/*.cpp)
add_library(yogacore STATIC ${yogacore_SRC})

target_include_directories(yogacore PUBLIC .)

target_link_libraries(yogacore android log)
add_subdirectory(yoga)
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ add_compile_options(
$<$<CONFIG:RELEASE>:-O2>
# Enable separate sections per function/data item
$<$<CONFIG:RELEASE>:-ffunction-sections>
$<$<CONFIG:RELEASE>:-fdata-sections>)
$<$<CONFIG:RELEASE>:-fdata-sections>
$<$<CONFIG:RELEASE>:-i-am-a-test-that-release-is-hit>)

add_link_options(
# Discard unused sections
Expand Down

0 comments on commit 4197691

Please sign in to comment.