diff options
| author | JackBoosY <47264268+JackBoosY@users.noreply.github.com> | 2019-06-19 02:11:06 +0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-06-18 11:11:06 -0700 |
| commit | 49d1759ec85c31eb50d07b42d245b989b99df37c (patch) | |
| tree | bd0ab8e468d82548751f577b40c992703ef11da6 | |
| parent | e4acc60b3c9acb7fe7a323f146234e3aeab7cab6 (diff) | |
| download | vcpkg-49d1759ec85c31eb50d07b42d245b989b99df37c.tar.gz vcpkg-49d1759ec85c31eb50d07b42d245b989b99df37c.zip | |
[spdlog]Add feature[benchmark] (#6924)
* [spdlog]Add feature[benchmark]
| -rw-r--r-- | ports/spdlog/CONTROL | 6 | ||||
| -rw-r--r-- | ports/spdlog/fix-feature-export.patch | 14 | ||||
| -rw-r--r-- | ports/spdlog/portfile.cmake | 10 |
3 files changed, 29 insertions, 1 deletions
diff --git a/ports/spdlog/CONTROL b/ports/spdlog/CONTROL index 38149a55c..aa5474709 100644 --- a/ports/spdlog/CONTROL +++ b/ports/spdlog/CONTROL @@ -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
\ No newline at end of file diff --git a/ports/spdlog/fix-feature-export.patch b/ports/spdlog/fix-feature-export.patch new file mode 100644 index 000000000..ad1239fd7 --- /dev/null +++ b/ports/spdlog/fix-feature-export.patch @@ -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 diff --git a/ports/spdlog/portfile.cmake b/ports/spdlog/portfile.cmake index 530e8b084..37cd8644f 100644 --- a/ports/spdlog/portfile.cmake +++ b/ports/spdlog/portfile.cmake @@ -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) |
