From a106137f707e35d178b716e086edd2e644d2622c Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Tue, 5 Jul 2022 09:12:07 -0500 Subject: [PATCH] fmt: Add version 9.0.0 Bump to rebuild. --- recipes/fmt/all/conandata.yml | 3 +++ recipes/fmt/all/conanfile.py | 3 ++- recipes/fmt/all/test_cmakedeps/conanfile.py | 3 ++- .../fmt/all/test_cmakedeps/test_package.cpp | 18 ++++++++++++------ recipes/fmt/all/test_package/conanfile.py | 3 ++- recipes/fmt/all/test_package/test_package.cpp | 17 ++++++++++++----- recipes/fmt/config.yml | 2 ++ 7 files changed, 35 insertions(+), 14 deletions(-) diff --git a/recipes/fmt/all/conandata.yml b/recipes/fmt/all/conandata.yml index 298bf7c570024..d9b43806d4218 100644 --- a/recipes/fmt/all/conandata.yml +++ b/recipes/fmt/all/conandata.yml @@ -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" diff --git a/recipes/fmt/all/conanfile.py b/recipes/fmt/all/conanfile.py index 558e62dde37cf..3a75a531c07d0 100644 --- a/recipes/fmt/all/conanfile.py +++ b/recipes/fmt/all/conanfile.py @@ -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" diff --git a/recipes/fmt/all/test_cmakedeps/conanfile.py b/recipes/fmt/all/test_cmakedeps/conanfile.py index 581338b207b56..c7e485dd61f28 100644 --- a/recipes/fmt/all/test_cmakedeps/conanfile.py +++ b/recipes/fmt/all/test_cmakedeps/conanfile.py @@ -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" diff --git a/recipes/fmt/all/test_cmakedeps/test_package.cpp b/recipes/fmt/all/test_cmakedeps/test_package.cpp index 76a2416d79aae..8c172fe7cc0ba 100644 --- a/recipes/fmt/all/test_cmakedeps/test_package.cpp +++ b/recipes/fmt/all/test_cmakedeps/test_package.cpp @@ -1,14 +1,14 @@ #include #include +#include #include #include #include - -#include "fmt/format.h" -#include "fmt/printf.h" -#include "fmt/ostream.h" -#include "fmt/color.h" +#include +#include +#include +#include void vreport(const char *format, fmt::format_args args) { @@ -30,6 +30,12 @@ class Date { } }; +#if FMT_VERSION >= 90000 +namespace fmt { + template <> struct formatter : ostream_formatter {}; +} +#endif + int main() { const std::string thing("World"); fmt::print("PRINT: Hello {}!\n", thing); @@ -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)); diff --git a/recipes/fmt/all/test_package/conanfile.py b/recipes/fmt/all/test_package/conanfile.py index f99cfc80791d2..188dd66c8f589 100644 --- a/recipes/fmt/all/test_package/conanfile.py +++ b/recipes/fmt/all/test_package/conanfile.py @@ -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" diff --git a/recipes/fmt/all/test_package/test_package.cpp b/recipes/fmt/all/test_package/test_package.cpp index 76a2416d79aae..bcd009407212d 100644 --- a/recipes/fmt/all/test_package/test_package.cpp +++ b/recipes/fmt/all/test_package/test_package.cpp @@ -1,14 +1,15 @@ #include #include +#include #include #include #include -#include "fmt/format.h" -#include "fmt/printf.h" -#include "fmt/ostream.h" -#include "fmt/color.h" +#include +#include +#include +#include void vreport(const char *format, fmt::format_args args) { @@ -30,6 +31,12 @@ class Date { } }; +#if FMT_VERSION >= 90000 +namespace fmt { + template <> struct formatter : ostream_formatter {}; +} +#endif + int main() { const std::string thing("World"); fmt::print("PRINT: Hello {}!\n", thing); @@ -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)); diff --git a/recipes/fmt/config.yml b/recipes/fmt/config.yml index 2a082123af8c3..f3b3d49b9bb2a 100644 --- a/recipes/fmt/config.yml +++ b/recipes/fmt/config.yml @@ -9,3 +9,5 @@ versions: folder: all "8.1.1": folder: all + "9.0.0": + folder: all