From 6764adafe4c702b3d514179e4e6cfa0534f44de2 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Thu, 11 May 2023 08:34:02 -0700 Subject: [PATCH] Use reference Yoga CMake build for libyogacore (#37371) Summary: X-link: https://github.com/facebook/yoga/pull/1291 Pull Request resolved: https://github.com/facebook/react-native/pull/37371 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 Reviewed By: cortinico Differential Revision: D45764537 fbshipit-source-id: 1aafd221d2afa994b6efae3c267ee7ffbdf0faad --- .../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 ff370aa76eb..644c6cb1b13 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)