Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fmt to 11.0.1, add example #355

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fmt/LICENSE
igrr marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion fmt/LICENSE.rst

This file was deleted.

5 changes: 5 additions & 0 deletions fmt/examples/hello_fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.16)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(COMPONENTS main)
project(hello_fmt)
18 changes: 18 additions & 0 deletions fmt/examples/hello_fmt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# `fmt` basic example

This is a basic example of using `fmt` library in an ESP-IDF project. It includes `fmt` and prints `Hello, fmt!` on the console.

The example runs on any ESP development board. To build and run the example, follow the same steps as for any other ESP-IDF project. For example, for ESP32-C3:

```bash
idf.py set-target esp32c3
idf.py flash monitor
```

The example should print the following:

```
I (6074) main_task: Calling app_main()
Hello, fmt!
I (6084) main_task: Returned from app_main()
```
2 changes: 2 additions & 0 deletions fmt/examples/hello_fmt/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
idf_component_register(SRCS "hello_fmt.cpp"
INCLUDE_DIRS ".")
12 changes: 12 additions & 0 deletions fmt/examples/hello_fmt/main/hello_fmt.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/

#include <fmt/core.h>

extern "C" void app_main()
{
fmt::print("Hello, fmt!\n");
}
4 changes: 4 additions & 0 deletions fmt/examples/hello_fmt/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies:
fmt:
version: "*"
override_path: "../../../"
11 changes: 11 additions & 0 deletions fmt/examples/hello_fmt/pytest_fmt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0

import pytest
from pytest_embedded import Dut


@pytest.mark.supported_targets
@pytest.mark.generic
def test_fmt_example(dut: Dut) -> None:
dut.expect_exact('Hello, fmt!')
2 changes: 1 addition & 1 deletion fmt/fmt
Submodule fmt updated 182 files
2 changes: 1 addition & 1 deletion fmt/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "10.1.0~1"
version: "11.0.1"
description: Formatting library providing a fast and safe alternative to C stdio and C++ iostreams.
url: https://github.com/espressif/idf-extra-components/tree/master/fmt
dependencies:
Expand Down
4 changes: 2 additions & 2 deletions fmt/sbom_fmt.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: fmt
version: 10.1.0
version: 11.0.1
cpe: cpe:2.3:a:fmt:fmt:{}:*:*:*:*:*:*:*
supplier: 'Organization: fmt <https://fmt.dev/latest/index.html>'
description: A modern formatting library
url: https://github.com/fmtlib/fmt/
hash: e57ca2e3685b160617d3d95fcd9e789c4e06ca88
hash: b50e685db996c167e6c831dcef582aba6e14276a
Loading