Skip to content

Commit a6f24a5

Browse files
cortinicofacebook-github-bot
authored andcommitted
Cleanup custom LOG_TAG in our CMakeLists files. (#51622)
Summary: Pull Request resolved: #51622 We currently support an optional 3rd params for `target_compile_reactnative_options` which allows to specify a LOG_TAG macro. No one is actually reading that Macro. The only usage would be logging from the Android SDK which we don't explicitely use. Here I'm updating our build to specify a LOG_TAG as `ReactNative` for all the targets without allowing to customize it as it just complicates our build setup. Changelog: [Internal] [Changed] - Reviewed By: mdvacca Differential Revision: D75445577 fbshipit-source-id: a426ce77ba6d1dfd0800e874d9f7838bfdc5b877
1 parent 17f1d91 commit a6f24a5

61 files changed

Lines changed: 63 additions & 78 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ target_include_directories(${CMAKE_PROJECT_NAME}
6868
${CMAKE_CURRENT_SOURCE_DIR}
6969
${PROJECT_BUILD_DIR}/generated/autolinking/src/main/jni)
7070

71-
target_compile_reactnative_options(${CMAKE_PROJECT_NAME} PRIVATE "ReactNative")
71+
target_compile_reactnative_options(${CMAKE_PROJECT_NAME} PRIVATE)
7272

7373
# Prefab packages from React Native
7474
find_package(ReactAndroid REQUIRED CONFIG)

packages/react-native/ReactAndroid/src/main/jni/react/devsupport/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ target_link_libraries(react_devsupportjni
2121
fbjni
2222
jsinspector)
2323

24-
target_compile_reactnative_options(react_devsupportjni PRIVATE "ReactNative")
24+
target_compile_reactnative_options(react_devsupportjni PRIVATE)

packages/react-native/ReactAndroid/src/main/jni/react/fabric/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ target_link_libraries(
6464
yoga
6565
)
6666

67-
target_compile_reactnative_options(fabricjni PRIVATE "Fabric")
67+
target_compile_reactnative_options(fabricjni PRIVATE)

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ target_link_libraries(
2626
)
2727

2828
target_merge_so(react_featureflagsjni)
29-
target_compile_reactnative_options(react_featureflagsjni PRIVATE "ReactNative")
29+
target_compile_reactnative_options(react_featureflagsjni PRIVATE)

packages/react-native/ReactAndroid/src/main/jni/react/mapbuffer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ target_link_libraries(mapbufferjni
3434
yoga
3535
)
3636

37-
target_compile_reactnative_options(mapbufferjni PRIVATE "Fabric")
37+
target_compile_reactnative_options(mapbufferjni PRIVATE)

packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ target_link_libraries(react_newarchdefaults
3131
react_nativemodule_idlecallbacks
3232
jsi)
3333

34-
target_compile_reactnative_options(react_newarchdefaults PRIVATE "ReactNative")
34+
target_compile_reactnative_options(react_newarchdefaults PRIVATE)

packages/react-native/ReactAndroid/src/main/jni/react/uimanager/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ target_link_libraries(uimanagerjni
3636
yoga
3737
)
3838

39-
target_compile_reactnative_options(uimanagerjni PRIVATE "ReactNative")
39+
target_compile_reactnative_options(uimanagerjni PRIVATE)

packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,18 @@ SET(reactnative_FLAGS
1616
-frtti
1717
-std=c++20
1818
-DFOLLY_NO_CONFIG=1
19+
-DLOG_TAG=\"ReactNative\"
1920
)
2021
2122
# This function can be used to configure the reactnative flags for a specific target in
2223
# a conveniente way. The usage is:
2324
#
24-
# target_compile_reactnative_options(target_name scope [tag])
25+
# target_compile_reactnative_options(target_name scope)
2526
#
2627
# scope is either PUBLIC, PRIVATE or INTERFACE
27-
# tag is optional and if set, will be passed to the -DLOG_TAG flag
2828
2929
function(target_compile_reactnative_options target_name scope)
3030
target_compile_options(${target_name} ${scope} ${reactnative_FLAGS})
3131
target_compile_definitions(${target_name} ${scope} RN_SERIALIZABLE_STATE)
32-
set (extra_args ${ARGN})
33-
list(LENGTH extra_args extra_count)
34-
set (tag "ReactNative")
35-
if (${extra_count} GREATER 0)
36-
list(GET extra_args 0 user_provided_tag)
37-
target_compile_options(${target_name} ${scope} -DLOG_TAG=\"${user_provided_tag}\")
38-
endif ()
3932
endfunction()
4033

packages/react-native/ReactCommon/cxxreact/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ target_link_libraries(react_cxxreact
2525
runtimeexecutor
2626
react_debug)
2727

28-
target_compile_reactnative_options(react_cxxreact PRIVATE "ReactNative")
28+
target_compile_reactnative_options(react_cxxreact PRIVATE)
2929
target_compile_options(react_cxxreact PRIVATE -Wno-unused-lambda-capture)

packages/react-native/ReactCommon/jsc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ if(NOT ${CMAKE_BUILD_TYPE} MATCHES Debug)
3030
target_compile_options(jscruntime PRIVATE -DNDEBUG)
3131
endif()
3232

33-
target_compile_reactnative_options(jscruntime PRIVATE "ReactNative")
33+
target_compile_reactnative_options(jscruntime PRIVATE)
3434
target_compile_options(jscruntime PRIVATE -O3 -Wno-unused-lambda-capture)

0 commit comments

Comments
 (0)