Skip to content

Commit

Permalink
[abseil] update to latest release (20230125.0) (#29692)
Browse files Browse the repository at this point in the history
* [abseil] update to latest release (20230125.0)

* Fix DLL support

* Update version

* I do not understand the warning about version-string, fixing it seems to make things worse

* [etcd-cpp-apiv3] Abseil requires C++14

* Update a downstream port

* I just cannot get these right, argh

* Try to switch from version-string to version (again)

* Regenerate versions

* Improve etcd handling of C++ standard

* Regenerate versions

* Use target_link_libraries to get compilation flags

* Update version files
  • Loading branch information
coryan committed Feb 21, 2023
1 parent f138027 commit 341d025
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 112 deletions.
94 changes: 0 additions & 94 deletions ports/abseil/fix-cxx-standard.patch

This file was deleted.

24 changes: 24 additions & 0 deletions ports/abseil/fix-dll-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake
index c4a41e6..da46613 100644
--- a/CMake/AbseilDll.cmake
+++ b/CMake/AbseilDll.cmake
@@ -787,7 +787,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
# Abseil libraries require C++14 as the current minimum standard. When
# compiled with C++17 (either because it is the compiler's default or
# explicitly requested), then Abseil requires C++17.
- _absl_target_compile_features_if_available(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
+ _absl_target_compile_features_if_available(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
else()
# Note: This is legacy (before CMake 3.8) behavior. Setting the
# target-level CXX_STANDARD property to ABSL_CXX_STANDARD (which is
@@ -797,8 +797,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
# CXX_STANDARD_REQUIRED does guard against the top-level CMake project
# not having enabled CMAKE_CXX_STANDARD_REQUIRED (which prevents
# "decaying" to an older standard if the requested one isn't available).
- set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
- set_property(TARGET ${_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+ set_property(TARGET ${_dll} PROPERTY CXX_STANDARD ${ABSL_CXX_STANDARD})
+ set_property(TARGET ${_dll} PROPERTY CXX_STANDARD_REQUIRED ON)
endif()

install(TARGETS ${_dll} EXPORT ${PROJECT_NAME}Targets
24 changes: 11 additions & 13 deletions ports/abseil/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,25 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO abseil/abseil-cpp
REF 8c0b94e793a66495e0b1f34a5eb26bd7dc672db0 # LTS 20220623.1
SHA512 a076c198103dc5cf22ac978fe7754dd34cb2e782d7db1c2c98393c94639e461bfe31b10c0663f750f743bc1c0c245fd4b6115356f136fe14bd036d267caf2a8b
REF 20230125.0
SHA512 b3d334215c78b31a2eb10bd9d4a978cd48367866d6daa2065c6c727282bafe19ef7ff5bd7cd4ed5c319d3b04e0711222e08ddbe7621ef1e079fed93a7307112f
HEAD_REF master
PATCHES
# in C++17 mode, use std::any, std::optional, std::string_view, std::variant
# instead of the library replacement types
# in C++11 mode, force use of library replacement types, otherwise the automatic
# detection can cause ABI issues depending on which compiler options
# are enabled for consuming user code
fix-cxx-standard.patch
fix-dll-support.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
cxx17 ABSL_USE_CXX17
)
# With ABSL_PROPAGATE_CXX_STD=ON abseil automatically detect if it is being
# compiled with C++14 or C++17, and modifies the installed `absl/base/options.h`
# header accordingly. This works even if CMAKE_CXX_STANDARD is not set. Abseil
# uses the compiler default behavior to update `absl/base/options.h` as needed.
if (ABSL_USE_CXX17 IN_LIST FEATURES)
set(ABSL_USE_CXX17_OPTION "-DCMAKE_CXX_STANDARD=17")
endif ()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS ${FEATURE_OPTIONS}
OPTIONS -DABSL_PROPAGATE_CXX_STD=ON ${ABSL_USE_CXX17_OPTION}
)

vcpkg_cmake_install()
Expand Down
2 changes: 1 addition & 1 deletion ports/abseil/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abseil",
"version-string": "20220623.1",
"version": "20230125.0",
"description": [
"an open-source collection designed to augment the C++ standard library.",
"Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.",
Expand Down
16 changes: 16 additions & 0 deletions ports/etcd-cpp-apiv3/0001-do-not-hardcode-cxx-standard.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2caacf8..ecdbce3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,10 +78,7 @@ macro(use_cxx target)
target_compile_options(${target} PRIVATE "-std=c++${ETCD_CMAKE_CXX_STANDARD}")
endif()
else()
- set_target_properties(${target} PROPERTIES
- CXX_STANDARD ${ETCD_CMAKE_CXX_STANDARD}
- CXX_STANDARD_REQUIRED ON
- )
+ target_compile_features(${target} PUBLIC cxx_std_${ETCD_CMAKE_CXX_STANDARD})
endif()
endmacro(use_cxx)

17 changes: 17 additions & 0 deletions ports/etcd-cpp-apiv3/0002-use-target-link-libraries.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8d5404f..e77e92a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -21,6 +21,12 @@ add_library(etcd-cpp-api-core-objects OBJECT ${CPP_CLIENT_CORE_SRC} ${PROTOBUF_G
use_cxx(etcd-cpp-api-core-objects)
add_dependencies(etcd-cpp-api-core-objects protobuf_generates)
include_generated_protobuf_files(etcd-cpp-api-core-objects)
+target_link_libraries(etcd-cpp-api-core-objects PUBLIC
+ ${Boost_LIBRARIES}
+ ${PROTOBUF_LIBRARIES}
+ ${OPENSSL_LIBRARIES}
+ ${GRPC_LIBRARIES}
+)

# add the core library, includes the sycnhronous client only
add_library(etcd-cpp-api-core $<TARGET_OBJECTS:etcd-cpp-api-core-objects>)
5 changes: 3 additions & 2 deletions ports/etcd-cpp-apiv3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ vcpkg_from_github(
REF 9e1e60af2ee99eafb4ea9b8d275870776b7d8507
SHA512 07e7922c96b0b9cb6502820d9dac96c60390e5d3c4d94e9eed7e847a3d1197e79dbfd4259cd1510ca02d669713a976bb027ba5decc2a44ca8e851109f2ef9c15
HEAD_REF v0.2.12
PATCHES
0001-do-not-hardcode-cxx-standard.patch
0002-use-target-link-libraries.patch
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_ETCD_TESTS=OFF
)
Expand All @@ -28,4 +30,3 @@ file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/s

# Adding usage text
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

1 change: 1 addition & 0 deletions ports/etcd-cpp-apiv3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "etcd-cpp-apiv3",
"version": "0.2.12",
"port-version": 1,
"description": "The etcd-cpp-apiv3 is a C++ API for etcd's v3 client API, i.e., ETCDCTL_API=3.",
"homepage": "https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3",
"license": "BSD-3-Clause",
Expand Down
5 changes: 5 additions & 0 deletions versions/a-/abseil.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "aa4f29f110c771e7096ba356501e4a0d6d3d9baa",
"version": "20230125.0",
"port-version": 0
},
{
"git-tree": "c569c0e44beca0b94d5a2d52a24e3a91868550ae",
"version-string": "20220623.1",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"port-version": 0
},
"abseil": {
"baseline": "20220623.1",
"baseline": "20230125.0",
"port-version": 0
},
"absent": {
Expand Down Expand Up @@ -2274,7 +2274,7 @@
},
"etcd-cpp-apiv3": {
"baseline": "0.2.12",
"port-version": 0
"port-version": 1
},
"etl": {
"baseline": "20.35.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/e-/etcd-cpp-apiv3.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7e0ac1c92bcc806390c387a4dc9a099f4d564fb9",
"version": "0.2.12",
"port-version": 1
},
{
"git-tree": "86cc86be00d148aaf3c011e1c248ea16e7e6d2fc",
"version": "0.2.12",
Expand Down

0 comments on commit 341d025

Please sign in to comment.