From dc32593cf8b88eb13ece91ca6d6149e4027d5f0d Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 11 May 2023 00:39:41 -0700 Subject: [PATCH] DRAFT: Use reference Yoga CMake build for libyogacore (#1291) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: X-link: https://github.com/facebook/yoga/pull/1291 Pull Request resolved: https://github.com/facebook/react-native/pull/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: fd4b3165ddffb32375b2840d9ae8635689104bde --- .../ReactCommon/yoga/CMakeLists.txt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/react-native/ReactCommon/yoga/CMakeLists.txt b/packages/react-native/ReactCommon/yoga/CMakeLists.txt index ff370aa76ebd05..644c6cb1b132e0 100644 --- a/packages/react-native/ReactCommon/yoga/CMakeLists.txt +++ b/packages/react-native/ReactCommon/yoga/CMakeLists.txt @@ -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)