mirror of
https://github.com/fmtlib/fmt.git
synced 2024-09-02 21:19:26 +00:00
Move speed-test to benchmarks.
This commit is contained in:
parent
19343ce274
commit
23eb9b4f4c
@ -118,56 +118,6 @@ add_test(compile-test ${CMAKE_CTEST_COMMAND}
|
||||
--build-generator ${CMAKE_GENERATOR}
|
||||
--build-makeprogram ${CMAKE_MAKE_PROGRAM})
|
||||
|
||||
find_library(PROFILER_LIB profiler)
|
||||
find_path(PROFILER_INCLUDE_DIR gperftools/profiler.h)
|
||||
if (PROFILER_LIB AND PROFILER_INCLUDE_DIR)
|
||||
include_directories(${PROFILER_INCLUDE_DIR})
|
||||
set(HAVE_PROFILER TRUE)
|
||||
endif ()
|
||||
|
||||
find_package(Boost)
|
||||
if (Boost_FOUND)
|
||||
add_definitions(-DHAVE_BOOST)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
endif ()
|
||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/format-benchmark/tinyformat_test.cpp)
|
||||
add_subdirectory(format-benchmark)
|
||||
|
||||
add_executable(tinyformat_speed_test format-benchmark/tinyformat_test.cpp)
|
||||
target_link_libraries(tinyformat_speed_test format)
|
||||
if (HAVE_PROFILER)
|
||||
target_link_libraries(tinyformat_speed_test ${PROFILER_LIB})
|
||||
set(PROFILE_DEFS ";FMT_PROFILE")
|
||||
endif ()
|
||||
set_target_properties(tinyformat_speed_test PROPERTIES COMPILE_DEFINITIONS
|
||||
"SPEED_TEST;HAVE_FORMAT;_SCL_SECURE_NO_WARNINGS;${PROFILE_DEFS}")
|
||||
if (CPP11_FLAG)
|
||||
set_target_properties(tinyformat_speed_test
|
||||
PROPERTIES COMPILE_FLAGS ${CPP11_FLAG})
|
||||
endif ()
|
||||
|
||||
add_custom_target(speed_test
|
||||
COMMAND @echo running speed tests...
|
||||
COMMAND @echo printf timings:
|
||||
COMMAND @time -p ./tinyformat_speed_test printf > /dev/null
|
||||
COMMAND @echo iostreams timings:
|
||||
COMMAND @time -p ./tinyformat_speed_test iostreams > /dev/null
|
||||
COMMAND @echo format timings:
|
||||
COMMAND @time -p ./tinyformat_speed_test format > /dev/null
|
||||
COMMAND @echo format98 timings:
|
||||
COMMAND @time -p ./tinyformat_speed_test format98 > /dev/null
|
||||
COMMAND @echo tinyformat timings:
|
||||
COMMAND @time -p ./tinyformat_speed_test tinyformat > /dev/null
|
||||
COMMAND @echo boost timings:
|
||||
COMMAND @time -p ./tinyformat_speed_test boost > /dev/null
|
||||
DEPENDS tinyformat_speed_test)
|
||||
|
||||
add_custom_target(bloat-test
|
||||
COMMAND ./bloat-test.py
|
||||
WORKING_DIRECTORY format-benchmark
|
||||
DEPENDS format)
|
||||
endif ()
|
||||
|
||||
if (EXISTS .gitignore)
|
||||
# Get the list of ignored files from .gitignore.
|
||||
file (STRINGS ".gitignore" lines)
|
||||
|
Loading…
Reference in New Issue
Block a user