Skip to content

Commit 653a55f

Browse files
Tidy up logging dependencies (#34789)
* Remove workarounds for stdio logging target This is no longer needed as of #32119 * Pull in android logging in the standard way
1 parent d31f7be commit 653a55f

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

src/lib/support/BUILD.gn

+3-5
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,9 @@ static_library("support") {
301301
"${chip_root}/src/inet:inet_config_header",
302302
]
303303

304-
# Android has no 'platform' that provides logging
305-
if (current_os == "android") {
306-
public_deps += [ "${chip_root}/src/platform/android:logging" ]
307-
}
308-
304+
# Platforms that utilize CHIP_SYSTEM_CONFIG_PLATFORM_LOG need to
305+
# be pulled in here as public_deps since they hook into logging at
306+
# the macro level rather than just providing a LogV implementation.
309307
if (current_os == "mac" || current_os == "ios") {
310308
public_deps += [ "${chip_root}/src/platform/Darwin:logging" ]
311309
}

src/platform/logging/BUILD.gn

+4-14
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ source_set("default") {
7676
deps += [ ":stdio" ]
7777
} else if (chip_device_platform == "nuttx") {
7878
deps += [ "${chip_root}/src/platform/NuttX:logging" ]
79+
} else if (chip_device_platform == "android") {
80+
deps += [ "${chip_root}/src/platform/android:logging" ]
7981
} else {
80-
assert(
81-
chip_device_platform == "fake" || chip_device_platform == "android" ||
82-
chip_device_platform == "external" || chip_device_platform == "none")
82+
assert(chip_device_platform == "fake" ||
83+
chip_device_platform == "external" || chip_device_platform == "none")
8384
}
8485
}
8586
}
@@ -88,11 +89,6 @@ source_set("headers") {
8889
public = [ "LogV.h" ]
8990
}
9091

91-
# We need to reference the output file of ":stdio" at build time,
92-
# but get_target_outputs() does not work for binary targets. As a
93-
# workaround, define a reasonable path and make the target use it.
94-
stdio_archive = "$root_out_dir/liblogging-stdio.a"
95-
9692
source_set("stdio") {
9793
sources = [ "impl/stdio/Logging.cpp" ]
9894

@@ -104,10 +100,4 @@ source_set("stdio") {
104100
"${chip_root}/src/platform:platform_config_header",
105101
"${chip_root}/src/platform/logging:headers",
106102
]
107-
108-
# Ensure we end up with the expected output file name
109-
output_dir = get_path_info(stdio_archive, "dir")
110-
output_name = get_path_info(stdio_archive, "name")
111-
output_extension = get_path_info(stdio_archive, "extension")
112-
output_prefix_override = true
113103
}

0 commit comments

Comments
 (0)