[spdlog]Add feature[benchmark] (#6924)

* [spdlog]Add feature[benchmark]
This commit is contained in:
JackBoosY 2019-06-19 02:11:06 +08:00 committed by Phil Christensen
parent e4acc60b3c
commit 49d1759ec8
3 changed files with 29 additions and 1 deletions

View File

@ -1,5 +1,9 @@
Source: spdlog
Version: 1.3.1
Version: 1.3.1-1
Homepage: https://github.com/gabime/spdlog
Description: Very fast, header only, C++ logging library
Build-Depends: fmt
Feature: benchmark
Description: Use google benchmark
Build-Depends: benchmark

View File

@ -0,0 +1,14 @@
diff --git a/bench/CMakeLists.txt b/bench/CMakeLists.txt
index 3c4a3f9..3bc3813 100644
--- a/bench/CMakeLists.txt
+++ b/bench/CMakeLists.txt
@@ -46,3 +46,8 @@ add_executable(formatter-bench formatter-bench.cpp)
target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog Threads::Threads)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs")
+
+install(TARGETS bench async_bench latency
+ RUNTIME DESTINATION tools/spdlog
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
\ No newline at end of file

View File

@ -1,5 +1,6 @@
#header-only library
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO gabime/spdlog
@ -8,19 +9,28 @@ vcpkg_from_github(
HEAD_REF v1.x
PATCHES
disable-master-project-check.patch
fix-feature-export.patch
)
set(SPDLOG_USE_BENCHMARK OFF)
if("benchmark" IN_LIST FEATURES)
set(SPDLOG_USE_BENCHMARK ON)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DSPDLOG_FMT_EXTERNAL=ON
-DSPDLOG_BUILD_BENCH=${SPDLOG_USE_BENCHMARK}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/spdlog)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)