Skip to content
forked from fmtlib/fmt

Commit

Permalink
Merge pull request #77 from fmtlib/master
Browse files Browse the repository at this point in the history
Sync Fork from Upstream Repo
  • Loading branch information
sthagen authored Jan 27, 2020
2 parents f2906bc + f499b39 commit 5aff30f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,17 @@ target_include_directories(fmt PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

set(FMT_DEBUG_POSTFIX d)

set_target_properties(fmt PROPERTIES
VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}
DEBUG_POSTFIX d)
DEBUG_POSTFIX ${FMT_DEBUG_POSTFIX})

# Set FMT_LIB_NAME for pkg-config fmt.pc.
get_target_property(FMT_LIB_NAME fmt OUTPUT_NAME)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(FMT_LIB_NAME ${FMT_LIB_NAME}${FMT_DEBUG_POSTFIX})
endif ()

if (BUILD_SHARED_LIBS)
if (UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
Expand Down
14 changes: 7 additions & 7 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,12 @@ FMT_CONSTEXPR const Char* parse_chrono_format(const Char* begin,
handler.on_text(ptr - 1, ptr);
break;
case 'n': {
const Char newline[]{'\n', 0};
const Char newline[] = {'\n'};
handler.on_text(newline, newline + 1);
break;
}
case 't': {
const Char tab[]{'\t', 0};
const Char tab[] = {'\t'};
handler.on_text(tab, tab + 1);
break;
}
Expand Down Expand Up @@ -761,10 +761,10 @@ inline std::chrono::duration<Rep, std::milli> get_milliseconds(

template <typename Char, typename Rep, typename OutputIt>
OutputIt format_duration_value(OutputIt out, Rep val, int precision) {
const Char pr_f[]{'{', ':', '.', '{', '}', 'f', '}', 0};
const Char pr_f[] = {'{', ':', '.', '{', '}', 'f', '}', 0};
if (precision >= 0) return format_to(out, pr_f, val, precision);
const Char fp_f[]{'{', ':', 'g', '}', 0};
const Char format[]{'{', '}', 0};
const Char fp_f[] = {'{', ':', 'g', '}', 0};
const Char format[] = {'{', '}', 0};
return format_to(out, std::is_floating_point<Rep>::value ? fp_f : format,
val);
}
Expand All @@ -779,9 +779,9 @@ OutputIt format_duration_unit(OutputIt out) {
}
return std::copy(s.begin(), s.end(), out);
}
const Char num_f[]{'[', '{', '}', ']', 's', 0};
const Char num_f[] = {'[', '{', '}', ']', 's', 0};
if (Period::den == 1) return format_to(out, num_f, Period::num);
const Char num_def_f[]{'[', '{', '}', '/', '{', '}', ']', 's', 0};
const Char num_def_f[] = {'[', '{', '}', '/', '{', '}', ']', 's', 0};
return format_to(out, num_def_f, Period::num, Period::den);
}

Expand Down
2 changes: 1 addition & 1 deletion support/cmake/fmt.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: fmt
Description: A modern formatting library
Version: @FMT_VERSION@
Libs: -L${libdir} -lfmt
Libs: -L${libdir} -l@FMT_LIB_NAME@
Cflags: -I${includedir}

0 comments on commit 5aff30f

Please sign in to comment.