| # See Project CHIP LICENSE file for licensing information. |
| |
| import("//build_overrides/build.gni") |
| import("//build_overrides/chip.gni") |
| import("//build_overrides/pigweed.gni") |
| |
| import("${chip_root}/src/lib/core/core.gni") |
| import("${chip_root}/src/lib/shell/shell_device.gni") |
| import("${chip_root}/src/platform/device.gni") |
| |
| source_set("default") { |
| if (!chip_use_external_logging) { |
| deps = [] |
| |
| if (chip_use_pw_logging) { |
| deps += [ "$dir_pw_log" ] |
| } |
| |
| if (chip_device_platform == "cyw30739") { |
| deps += [ "${chip_root}/src/platform/Infineon/CYW30739:logging" ] |
| } else if (chip_device_platform == "psoc6") { |
| deps += [ "${chip_root}/src/platform/Infineon/PSOC6:logging" ] |
| } else if (chip_device_platform == "cc32xx") { |
| deps += [ "${chip_root}/src/platform/cc32xx:logging" ] |
| } else if (chip_device_platform == "esp32") { |
| deps += [ "${chip_root}/src/platform/ESP32:logging" ] |
| } else if (chip_device_platform == "openiotsdk") { |
| deps += [ "${chip_root}/src/platform/openiotsdk:logging" ] |
| } else if (chip_device_platform == "mbed") { |
| deps += [ "${chip_root}/src/platform/mbed:logging" ] |
| } else if (chip_device_platform == "bl602" || |
| chip_device_platform == "bl702" || |
| chip_device_platform == "bl702l") { |
| deps += [ "${chip_root}/src/platform/bouffalolab/common:logging" ] |
| } else if (chip_device_platform == "mt793x") { |
| deps += [ "${chip_root}/src/platform/mt793x:logging" ] |
| } else if (chip_device_platform == "cc13x2_26x2") { |
| deps += [ "${chip_root}/src/platform/cc13xx_26xx/cc13x4_26x2:logging" ] |
| } else if (chip_device_platform == "cc13x4_26x4") { |
| deps += [ "${chip_root}/src/platform/cc13xx_26xx/cc13x4_26x4:logging" ] |
| } else if (chip_device_platform == "ameba") { |
| deps += [ "${chip_root}/src/platform/Ameba:logging" ] |
| } else if (chip_device_platform == "asr") { |
| deps += [ "${chip_root}/src/platform/ASR:logging" ] |
| } else if (chip_device_platform == "webos") { |
| deps += [ "${chip_root}/src/platform/webos:logging" ] |
| } else if (chip_device_platform == "zephyr") { |
| deps += [ "${chip_root}/src/platform/Zephyr:logging" ] |
| } else if (chip_device_platform == "nxp_zephyr") { |
| deps += [ "${chip_root}/src/platform/nxp/zephyr:logging" ] |
| } else if (chip_device_platform == "nrfconnect") { |
| deps += [ "${chip_root}/src/platform/nrfconnect:logging" ] |
| } else if (chip_device_platform == "telink") { |
| deps += [ "${chip_root}/src/platform/telink:logging" ] |
| } else if (chip_device_platform == "efr32") { |
| deps += [ "${chip_root}/src/platform/silabs/efr32:logging" ] |
| } else if (chip_device_platform == "SiWx917") { |
| deps += [ "${chip_root}/src/platform/silabs/SiWx917:logging" ] |
| } else if (chip_device_platform == "linux") { |
| deps += [ "${chip_root}/src/platform/Linux:logging" ] |
| } else if (chip_device_platform == "tizen") { |
| deps += [ "${chip_root}/src/platform/Tizen:logging" ] |
| } else if (chip_device_platform == "qpg") { |
| deps += [ "${chip_root}/src/platform/qpg:logging" ] |
| } else if (chip_device_platform == "darwin") { |
| deps += [ "${chip_root}/src/platform/Darwin:logging" ] |
| } else if (chip_device_platform == "mw320") { |
| deps += [ "${chip_root}/src/platform/nxp/mw320:logging" ] |
| } else if (chip_device_platform == "k32w0" || |
| chip_device_platform == "k32w1" || |
| chip_device_platform == "nxp") { |
| deps += [ "${chip_root}/src/platform/nxp:logging" ] |
| } else if (chip_device_platform == "beken") { |
| deps += [ "${chip_root}/src/platform/Beken:logging" ] |
| } else if (chip_device_platform == "stm32") { |
| deps += [ ":stdio" ] |
| } else if (chip_device_platform == "nuttx") { |
| deps += [ "${chip_root}/src/platform/NuttX:logging" ] |
| } else { |
| assert( |
| chip_device_platform == "fake" || chip_device_platform == "android" || |
| chip_device_platform == "external" || chip_device_platform == "none") |
| } |
| } |
| } |
| |
| source_set("headers") { |
| public = [ "LogV.h" ] |
| } |
| |
| # We need to reference the output file of ":stdio" at build time, |
| # but get_target_outputs() does not work for binary targets. As a |
| # workaround, define a reasonable path and make the target use it. |
| stdio_archive = "$root_out_dir/liblogging-stdio.a" |
| |
| source_set("stdio") { |
| sources = [ "impl/stdio/Logging.cpp" ] |
| |
| deps = [ |
| ":headers", |
| "${chip_root}/src/lib/core:chip_config_header", |
| "${chip_root}/src/lib/support:attributes", |
| "${chip_root}/src/lib/support:logging_constants", |
| "${chip_root}/src/platform:platform_config_header", |
| "${chip_root}/src/platform/logging:headers", |
| ] |
| |
| # Ensure we end up with the expected output file name |
| output_dir = get_path_info(stdio_archive, "dir") |
| output_name = get_path_info(stdio_archive, "name") |
| output_extension = get_path_info(stdio_archive, "extension") |
| output_prefix_override = true |
| } |