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

fmt: Add version 9.0.0 #11554

Merged
merged 1 commit into from
Jul 12, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/fmt/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ sources:
"8.1.1":
url: "https://github.com/fmtlib/fmt/archive/8.1.1.tar.gz"
sha256: "3d794d3cf67633b34b2771eb9f073bde87e846e0d395d254df7b211ef1ec7346"
"9.0.0":
url: "https://github.com/fmtlib/fmt/archive/9.0.0.tar.gz"
sha256: "9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5"
patches:
"5.3.0":
- patch_file: "patches/fix-install-5.3.0.patch"
Expand Down
3 changes: 2 additions & 1 deletion recipes/fmt/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os

from conan.tools.microsoft import msvc_runtime_flag
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.43.0"

Expand Down
3 changes: 2 additions & 1 deletion recipes/fmt/all/test_cmakedeps/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os

from conans import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain
from conan.tools.cross_building import cross_building as tools_cross_building
from conan.tools.build.cross_building import cross_building as tools_cross_building
from conan.tools.layout import cmake_layout

required_conan_version = ">=1.43.0"
Expand Down
18 changes: 12 additions & 6 deletions recipes/fmt/all/test_cmakedeps/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>
#include <limits>


#include "fmt/format.h"
#include "fmt/printf.h"
#include "fmt/ostream.h"
#include "fmt/color.h"
#include <fmt/format.h>
#include <fmt/printf.h>
#include <fmt/ostream.h>
#include <fmt/color.h>


void vreport(const char *format, fmt::format_args args) {
Expand All @@ -30,6 +30,12 @@ class Date {
}
};

#if FMT_VERSION >= 90000
namespace fmt {
template <> struct formatter<Date> : ostream_formatter {};
}
#endif

int main() {
const std::string thing("World");
fmt::print("PRINT: Hello {}!\n", thing);
Expand All @@ -39,7 +45,7 @@ int main() {
fmt::print("{}\n", formatted);

fmt::memory_buffer buf;
fmt::format_to(buf, "{}", 2.7182818);
fmt::format_to(std::begin(buf), "{}", 2.7182818);
fmt::print("Euler number: {}\n", fmt::to_string(buf));

const std::string date = fmt::format("The date is {}\n", Date(2012, 12, 9));
Expand Down
3 changes: 2 additions & 1 deletion recipes/fmt/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from conans import ConanFile, CMake, tools
import os

from conans import ConanFile, CMake, tools


class TestPackageConan(ConanFile):
settings = "os", "arch", "compiler", "build_type"
Expand Down
17 changes: 12 additions & 5 deletions recipes/fmt/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>
#include <limits>


#include "fmt/format.h"
#include "fmt/printf.h"
#include "fmt/ostream.h"
#include "fmt/color.h"
#include <fmt/format.h>
#include <fmt/printf.h>
#include <fmt/ostream.h>
#include <fmt/color.h>


void vreport(const char *format, fmt::format_args args) {
Expand All @@ -30,6 +31,12 @@ class Date {
}
};

#if FMT_VERSION >= 90000
namespace fmt {
template <> struct formatter<Date> : ostream_formatter {};
}
#endif

int main() {
const std::string thing("World");
fmt::print("PRINT: Hello {}!\n", thing);
Expand All @@ -39,7 +46,7 @@ int main() {
fmt::print("{}\n", formatted);

fmt::memory_buffer buf;
fmt::format_to(buf, "{}", 2.7182818);
fmt::format_to(std::begin(buf), "{}", 2.7182818);
fmt::print("Euler number: {}\n", fmt::to_string(buf));

const std::string date = fmt::format("The date is {}\n", Date(2012, 12, 9));
Expand Down
2 changes: 2 additions & 0 deletions recipes/fmt/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ versions:
folder: all
"8.1.1":
folder: all
"9.0.0":
folder: all