Skip to content

Commit

Permalink
[abseil] Fix port bugs (#39664)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Jul 5, 2024
1 parent 74d4bc7 commit 47c736a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
12 changes: 12 additions & 0 deletions ports/abseil/779a356-test-allocator.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/absl/container/CMakeLists.txt b/absl/container/CMakeLists.txt
index 449a2cad17e..ee9ca9c3c4a 100644
--- a/absl/container/CMakeLists.txt
+++ b/absl/container/CMakeLists.txt
@@ -213,6 +213,7 @@ absl_cc_library(
DEPS
absl::config
GTest::gmock
+ TESTONLY
)

absl_cc_test(
22 changes: 6 additions & 16 deletions ports/abseil/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ vcpkg_from_github(
PATCHES
0001-revert-integer-to-string-conversion-optimizations.patch # Fix openvino MSVC compile error
0002-Fix-missing-include-random-for-std-uniform_int_distr.patch # Fix missing include for std::uniform_int_distribution
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
cxx17 ABSL_USE_CXX17
779a356-test-allocator.diff
)

# 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)
set(ABSL_USE_CXX17_OPTION "")
if ("cxx17" IN_LIST FEATURES)
set(ABSL_USE_CXX17_OPTION "-DCMAKE_CXX_STANDARD=17")
endif ()

Expand All @@ -46,16 +43,9 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/include/absl/time/internal/cctz/testdata"
)

if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(GLOB_RECURSE headers "${CURRENT_PACKAGES_DIR}/include/absl/*.h")
foreach(header IN LISTS ${headers})
vcpkg_replace_string("${header}"
"!defined(ABSL_CONSUME_DLL)" "0"
)
vcpkg_replace_string("${header}"
"defined(ABSL_CONSUME_DLL)" "1"
)
endforeach()
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/absl/base/config.h" "defined(ABSL_CONSUME_DLL)" "1")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/absl/base/internal/thread_identity.h" "defined(ABSL_CONSUME_DLL)" "1")
endif()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
2 changes: 1 addition & 1 deletion ports/abseil/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "abseil",
"version": "20240116.2",
"port-version": 2,
"port-version": 3,
"description": [
"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.",
"In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.",
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": "dcd1d7ce3c896f86473b155e608bb9cfdaae2d94",
"version": "20240116.2",
"port-version": 3
},
{
"git-tree": "26ec106886be2fb2bc0f35b0bda9a1d3d5f01717",
"version": "20240116.2",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"abseil": {
"baseline": "20240116.2",
"port-version": 2
"port-version": 3
},
"absent": {
"baseline": "0.3.1",
Expand Down

0 comments on commit 47c736a

Please sign in to comment.