Skip to content

Commit c472ab8

Browse files
committed
Update fmt
1 parent cfcf717 commit c472ab8

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[submodule "cppformat"]
2-
path = cppformat
3-
url = https://github.com/cppformat/cppformat.git
1+
[submodule "fmt"]
2+
path = fmt
3+
url = https://github.com/fmtlib/fmt.git
44
[submodule "benchmark"]
55
path = benchmark
66
url = [email protected]:google/benchmark.git

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ endif ()
1919
# Use shared libraries to make comparison with IOStreams and printf
2020
# fair as these use shared libraries too (libstdc++ and libc).
2121
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared library instead of static one")
22-
add_subdirectory(cppformat)
22+
add_subdirectory(fmt)
2323

2424
find_package(Boost)
2525
if (Boost_FOUND)
2626
add_definitions(-DHAVE_BOOST)
2727
include_directories(${Boost_INCLUDE_DIRS})
2828
add_executable(int-generator int_generator.cpp ltoa.c)
29-
target_link_libraries(int-generator cppformat)
29+
target_link_libraries(int-generator fmt)
3030
find_library(HAVE_RT rt)
3131
if (HAVE_RT)
3232
target_link_libraries(int-generator rt)
@@ -41,7 +41,7 @@ if (PROFILER_LIB AND PROFILER_INCLUDE_DIR)
4141
endif ()
4242

4343
add_executable(tinyformat_speed_test tinyformat_test.cpp)
44-
target_link_libraries(tinyformat_speed_test cppformat)
44+
target_link_libraries(tinyformat_speed_test fmt)
4545
if (HAVE_PROFILER)
4646
target_link_libraries(tinyformat_speed_test ${PROFILER_LIB})
4747
set(PROFILE_DEFS ";FMT_PROFILE")
@@ -91,12 +91,12 @@ endif()
9191

9292
add_custom_target(bloat-test
9393
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bloat-test.py -I${Boost_INCLUDE_DIRS}
94-
DEPENDS cppformat)
94+
DEPENDS fmt)
9595

9696
add_custom_target(variadic-test
9797
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/variadic-test.py
9898
\${ARGS} -I${Boost_INCLUDE_DIRS}
99-
DEPENDS cppformat)
99+
DEPENDS fmt)
100100

101101
enable_testing()
102102
add_subdirectory(benchmark)

bloat-test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
boost::format("%s:%d:%d:%d:%s\n") % "somefile.cpp" % 42 % 1 % 2 % "asdf";
2828
}
2929
30-
#elif defined(USE_CPPFORMAT)
30+
#elif defined(USE_FMT)
3131
32-
#include "cppformat/format.h"
32+
#include "fmt/format.h"
3333
3434
void doFormat_a() {
3535
fmt::print("{}\n", "somefile.cpp");
@@ -139,7 +139,7 @@ def benchmark(flags):
139139
result.stripped_size = os.stat(output_filename).st_size
140140
print('Stripped size: {}'.format(result.stripped_size))
141141
p = Popen(['./' + output_filename], stdout=PIPE,
142-
env={'LD_LIBRARY_PATH': 'cppformat'})
142+
env={'LD_LIBRARY_PATH': 'fmt/fmt'})
143143
output = p.communicate()[0]
144144
global expected_output
145145
if not expected_output:
@@ -157,7 +157,7 @@ def benchmark(flags):
157157
methods = [
158158
('printf' , []),
159159
('IOStreams' , ['-DUSE_IOSTREAMS']),
160-
('C++ Format' , ['-DUSE_CPPFORMAT', '-Lcppformat', '-lcppformat']),
160+
('fmt' , ['-DUSE_FMT', '-Ifmt', 'fmt/fmt/libfmt.so']),
161161
('tinyformat' , ['-DUSE_TINYFORMAT']),
162162
('Boost Format', ['-DUSE_BOOST'])
163163
]

cppformat

Lines changed: 0 additions & 1 deletion
This file was deleted.

fmt

Submodule fmt added at b2a8141

variadic-test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
methods = [
6060
('printf' , []),
6161
('IOStreams' , ['-DUSE_IOSTREAMS']),
62-
('C++ Format' , ['-DUSE_CPPFORMAT', '-Lcppformat', '-lcppformat']),
62+
('fmt' , ['-DUSE_FMT', '-Lfmt', '-lfmt']),
6363
('tinyformat' , ['-DUSE_TINYFORMAT']),
6464
('Boost Format', ['-DUSE_BOOST'])
6565
]
@@ -70,7 +70,7 @@
7070
'sep': ' % ',
7171
'specifier': '%{type}',
7272
},
73-
'cppformat': {
73+
'fmt': {
7474
'statement': r'fmt::print("{fmt_str}\n", {args});',
7575
'sep': ', ',
7676
'specifier': '{{:{type}}}',
@@ -100,11 +100,11 @@
100100
101101
{boost}
102102
103-
#elif defined(USE_CPPFORMAT)
103+
#elif defined(USE_FMT)
104104
105-
#include "cppformat/format.h"
105+
#include "fmt/format.h"
106106
107-
{cppformat}
107+
{fmt}
108108
109109
#elif defined(USE_IOSTREAMS)
110110
@@ -295,7 +295,7 @@ def measure_compile(compiler_path, sources, flags):
295295
result['stripped_size'] = os.stat(output_filename).st_size
296296

297297
p = Popen(['./' + output_filename], stdout=PIPE,
298-
env={'LD_LIBRARY_PATH': 'cppformat'})
298+
env={'LD_LIBRARY_PATH': 'fmt'})
299299
result['output'] = p.communicate()[0]
300300
sys.stdout.flush()
301301

0 commit comments

Comments
 (0)