mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
feat: std::format
usage enabled for VS2022
This commit is contained in:
@@ -63,9 +63,12 @@ class UnitsConan(ConanFile):
|
||||
|
||||
@property
|
||||
def _use_libfmt(self):
|
||||
# compiler = self.settings.compiler
|
||||
# return compiler != "Visual Studio" and compiler != "msvc" # TODO Enable when VS std::format_to(ctx.out, ...) is fixed
|
||||
return True
|
||||
compiler = self.settings.compiler
|
||||
version = Version(self.settings.compiler.version)
|
||||
std_support = \
|
||||
(compiler == "Visual Studio" and version >= "17" and compiler.cppstd == 23) or \
|
||||
(compiler == "msvc" and (version == "19.3" or version >= "19.30") and compiler.cppstd == 23)
|
||||
return not std_support
|
||||
|
||||
def set_version(self):
|
||||
content = tools.load(os.path.join(self.recipe_folder, "src/CMakeLists.txt"))
|
||||
|
@@ -72,7 +72,7 @@ using namespace glide_computer;
|
||||
|
||||
void print(std::string_view phase_name, timestamp start_ts, const glide_computer::flight_point& point, const glide_computer::flight_point& new_point)
|
||||
{
|
||||
fmt::print(
|
||||
std::cout << STD_FMT::format(
|
||||
"| {:<12} | {:>9%.1Q %q} (Total: {:>9%.1Q %q}) | {:>8%.1Q %q} (Total: {:>8%.1Q %q}) | {:>7%.0Q %q} ({:>6%.0Q %q}) |\n",
|
||||
phase_name, quantity_cast<si::minute>(new_point.ts - point.ts), quantity_cast<si::minute>(new_point.ts - start_ts),
|
||||
new_point.dist - point.dist, new_point.dist, new_point.alt - point.alt, new_point.alt);
|
||||
|
2
src/core/include/units/bits/external/hacks.h
vendored
2
src/core/include/units/bits/external/hacks.h
vendored
@@ -22,6 +22,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <version>
|
||||
|
||||
#if __clang__
|
||||
#define UNITS_COMP_CLANG __clang_major__
|
||||
#elif __GNUC__
|
||||
|
Reference in New Issue
Block a user