mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-22 02:20:06 +00:00
Add base.h
This commit is contained in:
parent
4d616479b5
commit
79f1506fe3
@ -167,10 +167,10 @@ if (CMAKE_SYSTEM_NAME STREQUAL "MSDOS")
|
|||||||
message(STATUS "MSDOS is incompatible with gtest")
|
message(STATUS "MSDOS is incompatible with gtest")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Get version from core.h
|
# Get version from base.h
|
||||||
file(READ include/fmt/core.h core_h)
|
file(READ include/fmt/base.h core_h)
|
||||||
if (NOT core_h MATCHES "FMT_VERSION ([0-9]+)([0-9][0-9])([0-9][0-9])")
|
if (NOT core_h MATCHES "FMT_VERSION ([0-9]+)([0-9][0-9])([0-9][0-9])")
|
||||||
message(FATAL_ERROR "Cannot get FMT_VERSION from core.h.")
|
message(FATAL_ERROR "Cannot get FMT_VERSION from base.h.")
|
||||||
endif ()
|
endif ()
|
||||||
# Use math to skip leading zeros if any.
|
# Use math to skip leading zeros if any.
|
||||||
math(EXPR CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
|
math(EXPR CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||||
@ -274,7 +274,7 @@ function(add_headers VAR)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Define the fmt library, its includes and the needed defines.
|
# Define the fmt library, its includes and the needed defines.
|
||||||
add_headers(FMT_HEADERS args.h chrono.h color.h compile.h core.h format.h
|
add_headers(FMT_HEADERS args.h chrono.h color.h compile.h base.h format.h
|
||||||
format-inl.h os.h ostream.h printf.h ranges.h std.h
|
format-inl.h os.h ostream.h printf.h ranges.h std.h
|
||||||
xchar.h)
|
xchar.h)
|
||||||
set(FMT_SOURCES src/format.cc)
|
set(FMT_SOURCES src/format.cc)
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
# include <bit> // std::bit_cast
|
# include <bit> // std::bit_cast
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "core.h"
|
#include "base.h"
|
||||||
|
|
||||||
// libc++ supports string_view in pre-c++17.
|
// libc++ supports string_view in pre-c++17.
|
||||||
#if FMT_HAS_INCLUDE(<string_view>) && \
|
#if FMT_HAS_INCLUDE(<string_view>) && \
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "fmt/core.h"
|
#include "fmt/base.h"
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
for (int i = 0; i < argc; ++i) fmt::print("{}: {}\n", i, argv[i]);
|
for (int i = 0; i < argc; ++i) fmt::print("{}: {}\n", i, argv[i]);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// For the license information refer to format.h.
|
// For the license information refer to format.h.
|
||||||
|
|
||||||
#include "fmt/core.h"
|
#include "fmt/base.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
TEST(assert_test, fail) {
|
TEST(assert_test, fail) {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "test-assert.h"
|
#include "test-assert.h"
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#include "fmt/core.h"
|
#include "fmt/base.h"
|
||||||
|
|
||||||
#include <climits> // INT_MAX
|
#include <climits> // INT_MAX
|
||||||
#include <cstring> // std::strlen
|
#include <cstring> // std::strlen
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <fmt/core.h>
|
#include <fmt/base.h>
|
||||||
|
|
||||||
// The purpose of this part is to ensure NVCC's host compiler also supports
|
// The purpose of this part is to ensure NVCC's host compiler also supports
|
||||||
// the standard version. See 'cuda-cpp14.cu'.
|
// the standard version. See 'cuda-cpp14.cu'.
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
// https://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros
|
// https://en.cppreference.com/w/cpp/preprocessor/replace#Predefined_macros
|
||||||
static_assert(__cplusplus >= 201402L, "expect C++ 2014 for nvcc");
|
static_assert(__cplusplus >= 201402L, "expect C++ 2014 for nvcc");
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/base.h>
|
||||||
|
|
||||||
#include <cuda.h>
|
#include <cuda.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#ifndef FUZZER_COMMON_H
|
#ifndef FUZZER_COMMON_H
|
||||||
#define FUZZER_COMMON_H
|
#define FUZZER_COMMON_H
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/base.h>
|
||||||
|
|
||||||
#include <cstdint> // std::uint8_t
|
#include <cstdint> // std::uint8_t
|
||||||
#include <cstring> // memcpy
|
#include <cstring> // memcpy
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Header-only configuration test
|
// Header-only configuration test
|
||||||
|
|
||||||
#include "fmt/core.h"
|
#include "fmt/base.h"
|
||||||
#include "fmt/ostream.h"
|
#include "fmt/ostream.h"
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
// For the license information refer to format.h.
|
// For the license information refer to format.h.
|
||||||
|
|
||||||
#include "fmt/args.h"
|
#include "fmt/args.h"
|
||||||
|
#include "fmt/base.h"
|
||||||
#include "fmt/chrono.h"
|
#include "fmt/chrono.h"
|
||||||
#include "fmt/color.h"
|
#include "fmt/color.h"
|
||||||
#include "fmt/compile.h"
|
#include "fmt/compile.h"
|
||||||
#include "fmt/core.h"
|
|
||||||
#include "fmt/format.h"
|
#include "fmt/format.h"
|
||||||
#include "fmt/os.h"
|
#include "fmt/os.h"
|
||||||
#include "fmt/ostream.h"
|
#include "fmt/ostream.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user