Skip to content

Commit

Permalink
[zlib] Add cmake wrapper (#18914)
Browse files Browse the repository at this point in the history
* Format manifest

* Add cmake wrapper

* x-add-version

* Always use vcpkg zlib for sentry native

* x-add-version

* Fix and simplify wrapper

* Update git-tree
  • Loading branch information
dg0yt committed Jul 26, 2021
1 parent f6e78c3 commit 7dbc055
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 8 deletions.
2 changes: 2 additions & 0 deletions ports/sentry-native/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vcpkg_extract_source_archive_ex(
fix-warningC5105.patch
fix-config-cmake.patch
fix-libcurl.patch
use-zlib-target.patch
)

if (NOT DEFINED SENTRY_BACKEND)
Expand All @@ -37,6 +38,7 @@ vcpkg_configure_cmake(
-DSENTRY_BUILD_TESTS=OFF
-DSENTRY_BUILD_EXAMPLES=OFF
-DSENTRY_BACKEND=${SENTRY_BACKEND}
-DCRASHPAD_ZLIB_SYSTEM=ON
)

vcpkg_install_cmake()
Expand Down
12 changes: 12 additions & 0 deletions ports/sentry-native/use-zlib-target.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/external/crashpad/CMakeLists.txt b/external/crashpad/CMakeLists.txt
index abb0697..a57ff04 100644
--- a/external/crashpad/CMakeLists.txt
+++ b/external/crashpad/CMakeLists.txt
@@ -22,6 +22,7 @@ option(CRASHPAD_ZLIB_SYSTEM "Use system zlib library" "${CRASHPAD_ZLIB_SYSTEM_DE

if(CRASHPAD_ZLIB_SYSTEM)
find_package(ZLIB REQUIRED)
+ set(ZLIB_LIBRARIES ZLIB::ZLIB)
endif()

if(LINUX OR ANDROID)
4 changes: 3 additions & 1 deletion ports/sentry-native/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "sentry-native",
"version-semver": "0.4.11",
"port-version": 1,
"description": "Sentry SDK for C, C++ and native applications.",
"homepage": "https://sentry.io/",
"supports": "!(arm | (arm64 & !osx) | uwp)",
"dependencies": [
{
"name": "curl",
"platform": "!windows"
}
},
"zlib"
]
}
5 changes: 0 additions & 5 deletions ports/zlib/CONTROL

This file was deleted.

1 change: 1 addition & 0 deletions ports/zlib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ vcpkg_configure_cmake(
)

vcpkg_install_cmake()
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})

# Install the pkgconfig file
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
Expand Down
13 changes: 13 additions & 0 deletions ports/zlib/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set(ZLIB_ROOT "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS "${ZLIB_ROOT}/include" NO_DEFAULT_PATH)
find_library(ZLIB_LIBRARY_RELEASE NAMES zlib z PATHS "${ZLIB_ROOT}/lib" NO_DEFAULT_PATH)
find_library(ZLIB_LIBRARY_DEBUG NAMES zlibd z PATHS "${ZLIB_ROOT}/debug/lib" NO_DEFAULT_PATH)
if(NOT ZLIB_INCLUDE_DIR OR NOT ZLIB_LIBRARY_RELEASE OR (NOT ZLIB_LIBRARY_DEBUG AND EXISTS "${ZLIB_ROOT}/debug/lib"))
message("Broken installation of vcpkg port zlib")
endif()
if(CMAKE_VERSION VERSION_LESS 3.4)
include(SelectLibraryConfigurations)
select_library_configurations(ZLIB)
unset(ZLIB_FOUND)
endif()
_find_package(${ARGS})
7 changes: 7 additions & 0 deletions ports/zlib/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "zlib",
"version-string": "1.2.11",
"port-version": 11,
"description": "A compression library",
"homepage": "https://www.zlib.net/"
}
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5762,7 +5762,7 @@
},
"sentry-native": {
"baseline": "0.4.11",
"port-version": 0
"port-version": 1
},
"septag-sx": {
"baseline": "2019-05-07-2",
Expand Down Expand Up @@ -6894,7 +6894,7 @@
},
"zlib": {
"baseline": "1.2.11",
"port-version": 10
"port-version": 11
},
"zlib-ng": {
"baseline": "2.0.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/sentry-native.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a2864f84fc6ef423bcc641b64b75cc574df99b85",
"version-semver": "0.4.11",
"port-version": 1
},
{
"git-tree": "8343307e093e40faaf7e894be6aed4f60cb327d0",
"version-semver": "0.4.11",
Expand Down
5 changes: 5 additions & 0 deletions versions/z-/zlib.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ad5b59cd3722af26f09921297562dfc76c83dbf8",
"version-string": "1.2.11",
"port-version": 11
},
{
"git-tree": "53a4615c8bb9b98a3864b834a6bbe51cc6c849ef",
"version-string": "1.2.11",
Expand Down

0 comments on commit 7dbc055

Please sign in to comment.