mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 17:12:47 +08:00
[loguru] Add feature to build with fmt (#23242)
* [loguru] Add loguru[fmt] feature Add fmt feature, with if checks to require and link fmt if it is specified * [loguru] Replace deprecated functions Remove deprecated functions vcpkg_install_cmake, vcpkg_fixup_cmake_targets, vcpkg_configure_cmake and replace them with vcpkg_cmake_install, vcpkg_cmake_config_fixup and vcpkg_cmake_configure respectively. Also add vcpkg-cmake and vcpkg-cmake-config to vcpkg.json to provide the replacements * [loguru] Update versioning files * [loguru] Add CONFIG flag to find_package(fmt) * Make suggested changes * Update version database * Make requested changes * [loguru] Update version database
This commit is contained in:
parent
6f706ab611
commit
91dd9ae821
@ -4,6 +4,7 @@ project(loguru CXX)
|
|||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
option(INSTALL_HEADERS "Install header files" ON)
|
option(INSTALL_HEADERS "Install header files" ON)
|
||||||
|
option(BUILD_WITH_FMT "Build with fmt support" OFF)
|
||||||
|
|
||||||
set(loguru_headers
|
set(loguru_headers
|
||||||
loguru.hpp
|
loguru.hpp
|
||||||
@ -17,6 +18,12 @@ target_include_directories(loguru PUBLIC
|
|||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
$<INSTALL_INTERFACE:include/loguru>)
|
$<INSTALL_INTERFACE:include/loguru>)
|
||||||
|
|
||||||
|
if(BUILD_WITH_FMT)
|
||||||
|
target_compile_definitions(loguru PRIVATE LOGURU_USE_FMTLIB=1)
|
||||||
|
find_package(fmt CONFIG REQUIRED)
|
||||||
|
target_link_libraries(loguru PUBLIC fmt::fmt)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
@ -15,15 +15,22 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
|
|||||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt COPYONLY)
|
||||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/loguruConfig.cmake.in ${SOURCE_PATH}/loguruConfig.cmake.in COPYONLY)
|
configure_file(${CMAKE_CURRENT_LIST_DIR}/loguruConfig.cmake.in ${SOURCE_PATH}/loguruConfig.cmake.in COPYONLY)
|
||||||
|
|
||||||
vcpkg_configure_cmake(
|
vcpkg_check_features(
|
||||||
SOURCE_PATH ${SOURCE_PATH}
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||||
PREFER_NINJA
|
FEATURES
|
||||||
|
fmt BUILD_WITH_FMT
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_cmake_configure(
|
||||||
|
SOURCE_PATH "${SOURCE_PATH}"
|
||||||
OPTIONS_DEBUG
|
OPTIONS_DEBUG
|
||||||
-DINSTALL_HEADERS=OFF
|
-DINSTALL_HEADERS=OFF
|
||||||
|
OPTIONS
|
||||||
|
${FEATURE_OPTIONS}
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_install_cmake()
|
vcpkg_cmake_install()
|
||||||
vcpkg_fixup_cmake_targets()
|
vcpkg_cmake_config_fixup()
|
||||||
vcpkg_copy_pdbs()
|
vcpkg_copy_pdbs()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,7 +1,25 @@
|
|||||||
{
|
{
|
||||||
"name": "loguru",
|
"name": "loguru",
|
||||||
"version-string": "2.1.0",
|
"version": "2.1.0",
|
||||||
"port-version": 2,
|
"port-version": 3,
|
||||||
"description": "A lightweight and flexible C++ logging library",
|
"description": "A lightweight and flexible C++ logging library",
|
||||||
"homepage": "https://github.com/emilk/loguru"
|
"homepage": "https://github.com/emilk/loguru",
|
||||||
|
"dependencies": [
|
||||||
|
{
|
||||||
|
"name": "vcpkg-cmake",
|
||||||
|
"host": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vcpkg-cmake-config",
|
||||||
|
"host": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"features": {
|
||||||
|
"fmt": {
|
||||||
|
"description": "Build with fmt support in non-header-only mode",
|
||||||
|
"dependencies": [
|
||||||
|
"fmt"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4270,7 +4270,7 @@
|
|||||||
},
|
},
|
||||||
"loguru": {
|
"loguru": {
|
||||||
"baseline": "2.1.0",
|
"baseline": "2.1.0",
|
||||||
"port-version": 2
|
"port-version": 3
|
||||||
},
|
},
|
||||||
"lpeg": {
|
"lpeg": {
|
||||||
"baseline": "1.0.2",
|
"baseline": "1.0.2",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "827f85e170a1d4548088fa36cf46817e146184d0",
|
||||||
|
"version": "2.1.0",
|
||||||
|
"port-version": 3
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "c429f674d828c20881f410892d633b483e9d30dd",
|
"git-tree": "c429f674d828c20881f410892d633b483e9d30dd",
|
||||||
"version-string": "2.1.0",
|
"version-string": "2.1.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user