From f864d40de8f47d2665b1b1b300d48ec81d41a133 Mon Sep 17 00:00:00 2001 From: Lee Maguire Date: Thu, 30 May 2024 19:01:59 +0100 Subject: [PATCH] Add vcpkg patches to upstream --- CMakeLists.txt | 2 +- src/realm/object-store/index_set.hpp | 2 +- tools/cmake/RealmConfig.cmake.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d5710f1077..07ab42af07c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,7 +319,7 @@ endif() # Just use -lz and let Xcode figure it out # Emscripten does provide Zlib, but it doesn't work with find_package and is handled specially if(NOT APPLE AND NOT EMSCRIPTEN AND NOT TARGET ZLIB::ZLIB) - if(WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND REALM_LINUX_TOOLCHAIN)) + if((WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND REALM_LINUX_TOOLCHAIN)) AND NOT DEFINED VCPKG_TOOLCHAIN) find_package(ZLIB) if (NOT ZLIB_FOUND) realm_acquire_dependency(zlib ${DEP_ZLIB_VERSION} ZLIB_CMAKE_INCLUDE_FILE) diff --git a/src/realm/object-store/index_set.hpp b/src/realm/object-store/index_set.hpp index d61e78221f4..5eb5f164058 100644 --- a/src/realm/object-store/index_set.hpp +++ b/src/realm/object-store/index_set.hpp @@ -387,7 +387,7 @@ inline ChunkedRangeVectorIterator ChunkedRangeVectorIterator::operator--(i } template -#if REALM_WINDOWS && REALM_ARCHITECTURE_ARM64 +#if defined(_MSC_VER) && REALM_ARCHITECTURE_ARM64 // Inlining this function crashes msvc when targeting arm64 in as of 19.39.33523 __declspec(noinline) #endif diff --git a/tools/cmake/RealmConfig.cmake.in b/tools/cmake/RealmConfig.cmake.in index e418c869c99..dd269c3b131 100644 --- a/tools/cmake/RealmConfig.cmake.in +++ b/tools/cmake/RealmConfig.cmake.in @@ -22,7 +22,7 @@ find_dependency(Threads) # so for an iOS build it'll use the path from the Device plaform, which is an error on Simulator. # Just use -lz and let Xcode figure it out if(TARGET Realm::Sync AND NOT APPLE AND NOT TARGET ZLIB::ZLIB) - if(WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND REALM_LINUX_TOOLCHAIN)) + if((WIN32 OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND REALM_LINUX_TOOLCHAIN)) AND NOT DEFINED VCPKG_TOOLCHAIN) find_package(ZLIB) if (NOT ZLIB_FOUND) realm_acquire_dependency(zlib @DEP_ZLIB_VERSION@ ZLIB_CMAKE_INCLUDE_FILE)