vcpkg/ports/realm-core/portfile.cmake
jim wang 5eba049322
[vcpkg baseline][realm-core] Fix zlib lookup failure (#38832)
Fixes regression:
https://dev.azure.com/vcpkg/public/_build/results?buildId=103057&view=results
```
REGRESSION: realm-core:x64-android failed with BUILD_FAILED
REGRESSION: realm-core:arm-neon-android failed with BUILD_FAILED
REGRESSION: realm-core:arm64-android failed with BUILD_FAILED
```
Error:
```
CMake Error at /mnt/vcpkg-ci/installed/x64-android/share/zlib/vcpkg-cmake-wrapper.cmake:5 (message):
  Broken installation of vcpkg port zlib
Call Stack (most recent call first):
  /vcpkg/scripts/buildsystems/vcpkg.cmake:813 (include)
  CMakeLists.txt:336 (find_package)
```

- [X] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [ ] ~~SHA512s are updated for each updated download.~~
- [ ] ~~The "supports" clause reflects platforms that may be fixed by
this new version.~~
- [ ] ~~Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.~~
- [ ] ~~Any patches that are no longer applied are deleted from the
port's directory.~~
- [X] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [X] Only one version is added to each modified port's versions file.


Compile test pass with following triplets:
```
x64-android
arm64-android
```
2024-05-22 01:00:32 -07:00

40 lines
1.3 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO realm/realm-core
REF "9cf7ef4ad8e2f4c7a519c9a395ca3d253bb87aa8"
SHA512 "1bd11bfe70204213469687d1e224fabb2ff2798aa25f6d791b3d455acdcacf686248e7a692f23ed67148ef99faf1a7c1f823182f33a45340310477bc51b32bb7"
HEAD_REF "master"
PATCHES
"UWP_index_set.patch"
fix-zlib.patch
)
set(REALMCORE_CMAKE_OPTIONS -DREALM_CORE_SUBMODULE_BUILD=OFF)
list(APPEND REALMCORE_CMAKE_OPTIONS -DREALM_BUILD_LIB_ONLY=ON)
list(APPEND REALMCORE_CMAKE_OPTIONS -DREALM_NO_TESTS=ON)
list(APPEND REALMCORE_CMAKE_OPTIONS -DREALM_NEEDS_OPENSSL=ON)
if (ANDROID OR WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND REALMCORE_CMAKE_OPTIONS -DREALM_USE_SYSTEM_OPENSSL=ON)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
${REALMCORE_CMAKE_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME "realm" CONFIG_PATH "share/cmake/Realm")
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/doc"
"${CURRENT_PACKAGES_DIR}/doc"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")