From 3e5b9d4f5e903e710d0cb5c97ea4c45f4e11925f Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 29 Sep 2022 07:08:21 -0700 Subject: [PATCH] Move `glog` to be consumed via prefab Summary: This removes the old way of consuming `libglog.so` from `Android-prebuilt.cmake` to using Prefab which is natively supported by the Android pipeline. Changelog: [Internal] [Changed] - Move `glog` to be consumed via prefab Reviewed By: cipolleschi Differential Revision: D39927147 fbshipit-source-id: 99f0241da1dece0efc8d928c3d25f30f3fa48a09 --- ReactAndroid/build.gradle | 10 +++++++++- ReactAndroid/cmake-utils/Android-prebuilt.cmake | 8 -------- ReactAndroid/cmake-utils/ReactNative-application.cmake | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 01c5ec2de56..87154253506 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -108,6 +108,10 @@ final def preparePrefab = tasks.register("preparePrefab", PreparePrefabHeadersTa new PrefabPreprocessingEntry( "jsi", new Pair("../ReactCommon/jsi/", "") + ), + new PrefabPreprocessingEntry( + "glog", + new Pair(new File(buildDir, "third-party-ndk/glog/exported/").absolutePath, "") ) ] ) @@ -373,7 +377,8 @@ android { "react_render_core", "react_render_graphics", "rrc_view", - "jsi" + "jsi", + "glog" } } ndk { @@ -477,6 +482,9 @@ android { jsi { headers(new File(prefabHeadersDir, "jsi").absolutePath) } + glog { + headers(new File(prefabHeadersDir, "glog").absolutePath) + } } publishing { diff --git a/ReactAndroid/cmake-utils/Android-prebuilt.cmake b/ReactAndroid/cmake-utils/Android-prebuilt.cmake index 11f47554f83..76bc87ed26c 100644 --- a/ReactAndroid/cmake-utils/Android-prebuilt.cmake +++ b/ReactAndroid/cmake-utils/Android-prebuilt.cmake @@ -61,14 +61,6 @@ target_compile_options(folly_runtime -DFOLLY_MOBILE=1 -DFOLLY_HAVE_XSI_STRERROR_R=1) -## glog -add_library(glog SHARED IMPORTED GLOBAL) -set_target_properties(glog - PROPERTIES - IMPORTED_LOCATION - ${REACT_NDK_EXPORT_DIR}/${ANDROID_ABI}/libglog.so) -target_include_directories(glog INTERFACE ${THIRD_PARTY_NDK_DIR}/glog/exported) - ## yoga add_library(yoga SHARED IMPORTED GLOBAL) set_target_properties(yoga diff --git a/ReactAndroid/cmake-utils/ReactNative-application.cmake b/ReactAndroid/cmake-utils/ReactNative-application.cmake index 49e8b78280a..62c84e40368 100644 --- a/ReactAndroid/cmake-utils/ReactNative-application.cmake +++ b/ReactAndroid/cmake-utils/ReactNative-application.cmake @@ -52,12 +52,13 @@ add_library(react_render_core ALIAS ReactAndroid::react_render_core) add_library(react_render_graphics ALIAS ReactAndroid::react_render_graphics) add_library(rrc_view ALIAS ReactAndroid::rrc_view) add_library(jsi ALIAS ReactAndroid::jsi) +add_library(glog ALIAS ReactAndroid::glog) target_link_libraries(${CMAKE_PROJECT_NAME} fabricjni fbjni folly_runtime - glog + glog # prefab ready jsi # prefab ready react_codegen_rncore # prefab ready react_debug # prefab ready