Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[glog] Fixed gflags dependency #18739

Merged
merged 11 commits into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ports/gflags/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Source: gflags
Version: 2.2.2-1
Version: 2.2.2-2
bucurb marked this conversation as resolved.
Show resolved Hide resolved
Homepage: https://github.com/gflags/gflags
Description: A C++ library that implements commandline flags processing
Supports: !uwp
Supports: !uwp

Feature: target-namespace
Description: Enables the gflags:: target namespace
8 changes: 8 additions & 0 deletions ports/gflags/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ vcpkg_from_github(
fix_cmake_config.patch
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"target-namespace" GFLAGS_USE_TARGET_NAMESPACE
bucurb marked this conversation as resolved.
Show resolved Hide resolved
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
Expand All @@ -33,6 +39,8 @@ endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

set(_GFLAGS_USE_TARGET_NAMESPACE ${GFLAGS_USE_TARGET_NAMESPACE})
configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in ${CURRENT_PACKAGES_DIR}/share/gflags/vcpkg-cmake-wrapper.cmake @ONLY)
file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gflags RENAME copyright)
bucurb marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_copy_pdbs()
4 changes: 4 additions & 0 deletions ports/gflags/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(GFLAGS_USE_TARGET_NAMESPACE @_GFLAGS_USE_TARGET_NAMESPACE@)

_find_package(${ARGS})

2 changes: 1 addition & 1 deletion ports/glog/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: glog
Version: 0.4.0-3
Version: 0.4.0-4
bucurb marked this conversation as resolved.
Show resolved Hide resolved
Homepage: https://github.com/google/glog
Description: C++ implementation of the Google logging module
Build-Depends: gflags
27 changes: 27 additions & 0 deletions ports/glog/fix-gflags-target.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 808330e..acfb9f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,13 @@ set (CMAKE_THREAD_PREFER_PTHREAD 1)

if (WITH_GFLAGS)
find_package (gflags 2.2.0)
+
+ # Find a target
+ foreach (_GFLAGS_TARGET gflags gflags::gflags)
+ if (TARGET _GFLAGS_TARGET)
+ set(GFLAGS_TARGET _GFLAGS_TARGET)
+ endif()
+ endforeach (_GFLAGS_TARGET)

if (gflags_FOUND)
set (HAVE_LIB_GFLAGS 1)
@@ -489,7 +496,7 @@ if (WIN32 AND HAVE_SNPRINTF)
endif (WIN32 AND HAVE_SNPRINTF)

if (gflags_FOUND)
- target_link_libraries (glog PUBLIC gflags)
+ target_link_libraries (glog PUBLIC ${GFLAGS_TARGET})
bucurb marked this conversation as resolved.
Show resolved Hide resolved

if (NOT BUILD_SHARED_LIBS)
# Don't use __declspec(dllexport|dllimport) if this is a static build
1 change: 1 addition & 0 deletions ports/glog/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
glog_disable_debug_postfix.patch
fix-gflags-target.patch
)

vcpkg_configure_cmake(
Expand Down
8 changes: 4 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,7 @@
"port-version": 0
},
"gflags": {
"baseline": "2.2.2-1",
"baseline": "2.2.2-2",
"port-version": 0
},
"ghc-filesystem": {
Expand Down Expand Up @@ -2317,7 +2317,7 @@
"port-version": 4
},
"glog": {
"baseline": "0.4.0-3",
"baseline": "0.4.0-4",
"port-version": 0
},
"gloo": {
Expand Down Expand Up @@ -3539,8 +3539,8 @@
"libsigcpp-3": {
"baseline": "3.0.3",
"port-version": 1
},
"libsmb2": {
},
"libsmb2": {
"baseline": "2021-04-29",
"port-version": 0
},
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gflags.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2443da9e4f4ad5b21af4a2bd285c5596153798a0",
"version-string": "2.2.2-2",
"port-version": 0
},
bucurb marked this conversation as resolved.
Show resolved Hide resolved
{
"git-tree": "7dd635d5295af145f4601ba13219aa0d84630f27",
"version-string": "2.2.2-1",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/glog.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8f13f356599ab36476c5d45df57b9c4c9b3ca979",
"version-string": "0.4.0-4",
"port-version": 0
},
bucurb marked this conversation as resolved.
Show resolved Hide resolved
{
"git-tree": "ec7f01875b20c7145088d5ec7a1927a5faea5ca6",
"version-string": "0.4.0-3",
Expand Down