diff options
| author | NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> | 2020-12-18 03:53:17 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-17 11:53:17 -0800 |
| commit | ce5d30cb96f50d643a6a2c8dd5990e1d9b73323f (patch) | |
| tree | 1d7ffde3b192ed4ef122b1a90dd9a398a7691dd8 | |
| parent | 9a81392e48e88ac4789107b100b93504d4ac713c (diff) | |
| download | vcpkg-ce5d30cb96f50d643a6a2c8dd5990e1d9b73323f.tar.gz vcpkg-ce5d30cb96f50d643a6a2c8dd5990e1d9b73323f.zip | |
[osgearth/rocksdb] Update to latest release (#14976)
| -rw-r--r-- | ports/osgearth/CONTROL | 5 | ||||
| -rw-r--r-- | ports/osgearth/RocksDB.patch | 79 | ||||
| -rw-r--r-- | ports/osgearth/portfile.cmake | 24 | ||||
| -rw-r--r-- | ports/rocksdb/0001-disable-gtest.patch | 13 | ||||
| -rw-r--r-- | ports/rocksdb/0002-only-build-one-flavor.patch | 4 | ||||
| -rw-r--r-- | ports/rocksdb/0003-use-find-package.patch | 29 | ||||
| -rw-r--r-- | ports/rocksdb/0004-add-config-to-findpackage.patch | 13 | ||||
| -rw-r--r-- | ports/rocksdb/0004-fix-dependency-in-config.patch | 22 | ||||
| -rw-r--r-- | ports/rocksdb/0005-backport-msvc-fixes-pr-7439.patch | 256 | ||||
| -rw-r--r-- | ports/rocksdb/0005-do-not-install-cmake-modules.patch | 13 | ||||
| -rw-r--r-- | ports/rocksdb/CONTROL | 2 | ||||
| -rw-r--r-- | ports/rocksdb/portfile.cmake | 43 | ||||
| -rw-r--r-- | ports/rocksdb/vcpkg-cmake-wrapper.cmake | 9 |
13 files changed, 101 insertions, 411 deletions
diff --git a/ports/osgearth/CONTROL b/ports/osgearth/CONTROL index 6a23c4d31..c6d7b7a13 100644 --- a/ports/osgearth/CONTROL +++ b/ports/osgearth/CONTROL @@ -1,6 +1,5 @@ Source: osgearth
-Version: 3.0
-Port-Version: 2
+Version: 3.1
Homepage: https://github.com/gwaldron/osgearth Description: osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2015 Pelican Mapping.
-Build-Depends: osg[plugins]
+Build-Depends: osg[plugins]
\ No newline at end of file diff --git a/ports/osgearth/RocksDB.patch b/ports/osgearth/RocksDB.patch deleted file mode 100644 index c73cdad19..000000000 --- a/ports/osgearth/RocksDB.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/CMakeModules/FindRocksDB.cmake b/CMakeModules/FindRocksDB.cmake
-index b0692b0..984d3f2 100644
---- a/CMakeModules/FindRocksDB.cmake
-+++ b/CMakeModules/FindRocksDB.cmake
-@@ -39,5 +39,49 @@ find_package_handle_standard_args(ROCKSDB
- "Could NOT find ROCKSDB"
- )
-
-+if(ROCKSDB_FOUND)
-+ FIND_PACKAGE(ZLIB REQUIRED)
-+
-+ include(SelectLibraryConfigurations)
-+ # Find Snappy library
-+ find_library(SNAPPY_LIBRARY_DEBUG NAMES snappyd)
-+ find_library(SNAPPY_LIBRARY_RELEASE NAMES snappy)
-+ select_library_configurations(SNAPPY)
-+ find_package_handle_standard_args(SNAPPY
-+ FOUND_VAR
-+ SNAPPY_FOUND
-+ REQUIRED_VARS
-+ SNAPPY_LIBRARY
-+ FAIL_MESSAGE
-+ "Could NOT find SNAPPY"
-+ )
-+
-+ # Find LZ4 library
-+ find_library(LZ4_LIBRARY_DEBUG NAMES lz4d)
-+ find_library(LZ4_LIBRARY_RELEASE NAMES lz4)
-+ select_library_configurations(LZ4)
-+ find_package_handle_standard_args(LZ4
-+ FOUND_VAR
-+ LZ4_FOUND
-+ REQUIRED_VARS
-+ LZ4_LIBRARY
-+ FAIL_MESSAGE
-+ "Could NOT find LZ4"
-+ )
-+
-+ # Find ZSTD library
-+ find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd)
-+ find_library(ZSTD_LIBRARY_RELEASE NAMES zstd)
-+ select_library_configurations(ZSTD)
-+ find_package_handle_standard_args(ZSTD
-+ FOUND_VAR
-+ ZSTD_FOUND
-+ REQUIRED_VARS
-+ ZSTD_LIBRARY
-+ FAIL_MESSAGE
-+ "Could NOT find ZSTD_"
-+ )
-+endif(ROCKSDB_FOUND)
-+
- set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR} )
- set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY})
-diff --git a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt
-index ecaac34..b4ec764 100644
---- a/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt
-+++ b/src/osgEarthDrivers/cache_rocksdb/CMakeLists.txt
-@@ -34,7 +34,19 @@ IF(ROCKSDB_FOUND OR RocksDB_FOUND)
- RocksDBCacheDriver.cpp
- )
-
-- SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY)
-+ if(SNAPPY_FOUND)
-+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${SNAPPY_LIBRARY})
-+ endif(SNAPPY_FOUND)
-+
-+ if(LZ4_FOUND)
-+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${LZ4_LIBRARY})
-+ endif(LZ4_FOUND)
-+
-+ if(ZSTD_FOUND)
-+ SET(ROCKSDB_DEPENDENT_LIBRARY ${ROCKSDB_DEPENDENT_LIBRARY} ${ZSTD_LIBRARY})
-+ endif(ZSTD_FOUND)
-+
-+ SET(TARGET_LIBRARIES_VARS ROCKSDB_LIBRARY ZLIB_LIBRARY ROCKSDB_DEPENDENT_LIBRARY)
-
- IF(MSVC)
- SET(TARGET_EXTERNAL_LIBRARIES ws2_32 winmm rpcrt4 shlwapi)
diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index 5dc210912..7f8f9be1e 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -10,16 +10,21 @@ string(REPLACE "${CURRENT_INSTALLED_DIR}/tools/osg/" "" OSG_PLUGINS_SUBDIR "${OS vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO gwaldron/osgearth - REF dc73ac92b19fff1427414cfb981b6018c0ed88a1 #version 3.0 - SHA512 86c287a75946b902c05897d3952c9ff201853599d52023c7b2c850f2253b7e738c4b54ac7ae947bf0909b3aaf074bdb1472f4e92c59cd919458933a72fd13b80 + REF 342fcadf4c8892ba84841cb5b4162bdc51519e3c #version 3.1 + SHA512 03378a918306846d2144e545785c783b01e33fa2dd5c77d16d390a275217b6ce7a3a743c35ae99a497b272a7516b055442c0a891bd312cce727a5538b40364f5 HEAD_REF master - PATCHES - RocksDB.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + -DOSGEARTH_BUILD_EXAMPLES=OFF + -DOSGEARTH_BUILD_TESTS=OFF + -DOSGEARTH_BUILD_DOCS=OFF + -DOSGEARTH_BUILD_PROCEDURAL_NODEKIT=OFF + -DOSGEARTH_BUILD_TRITON_NODEKIT=OFF + -DOSGEARTH_BUILD_SILVERLINING_NODEKIT=OFF ) vcpkg_install_cmake() @@ -32,13 +37,13 @@ file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PATH}) file(MAKE_DIRECTORY ${OSGEARTH_TOOL_PLUGIN_PATH}) file(GLOB OSGEARTH_TOOLS ${CURRENT_PACKAGES_DIR}/bin/*.exe) -file(GLOB OSGDB_PLUGINS ${CURRENT_PACKAGES_DIR}/bin/osgdb*.dll) +file(GLOB OSGDB_PLUGINS ${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll) file(COPY ${OSGEARTH_TOOLS} DESTINATION ${OSGEARTH_TOOL_PATH}) file(COPY ${OSGDB_PLUGINS} DESTINATION ${OSGEARTH_TOOL_PLUGIN_PATH}) file(REMOVE_RECURSE ${OSGEARTH_TOOLS}) -file(REMOVE_RECURSE ${OSGDB_PLUGINS}) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/${OSG_PLUGINS_SUBDIR}) #Debug file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) @@ -50,14 +55,13 @@ file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PATH}) file(MAKE_DIRECTORY ${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH}) file(GLOB OSGEARTH_DEBUG_TOOLS ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) -file(GLOB OSGDB_DEBUG_PLUGINS ${CURRENT_PACKAGES_DIR}/debug/bin/osgdb*.dll) +file(GLOB OSGDB_DEBUG_PLUGINS ${CURRENT_PACKAGES_DIR}/debug/bin/${OSG_PLUGINS_SUBDIR}/osgdb*.dll) file(COPY ${OSGEARTH_DEBUG_TOOLS} DESTINATION ${OSGEARTH_DEBUG_TOOL_PATH}) file(COPY ${OSGDB_DEBUG_PLUGINS} DESTINATION ${OSGEARTH_DEBUG_TOOL_PLUGIN_PATH}) file(REMOVE_RECURSE ${OSGEARTH_DEBUG_TOOLS}) -file(REMOVE_RECURSE ${OSGDB_DEBUG_PLUGINS}) - +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin/${OSG_PLUGINS_SUBDIR}) # Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
\ No newline at end of file diff --git a/ports/rocksdb/0001-disable-gtest.patch b/ports/rocksdb/0001-disable-gtest.patch deleted file mode 100644 index 9c99f78ad..000000000 --- a/ports/rocksdb/0001-disable-gtest.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 01eea8889..14a4b1a40 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1015,7 +1015,7 @@ endif() - option(WITH_ALL_TESTS "Build all test, rather than a small subset" ON) - - if(WITH_TESTS OR WITH_BENCHMARK_TOOLS) -- add_subdirectory(third-party/gtest-1.8.1/fused-src/gtest) -+ #add_subdirectory(third-party/gtest-1.8.1/fused-src/gtest) - add_library(testharness STATIC - test_util/mock_time_env.cc - test_util/testharness.cc) diff --git a/ports/rocksdb/0002-only-build-one-flavor.patch b/ports/rocksdb/0002-only-build-one-flavor.patch index ec1051ac6..4ee4d2393 100644 --- a/ports/rocksdb/0002-only-build-one-flavor.patch +++ b/ports/rocksdb/0002-only-build-one-flavor.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f9c8f3346..74c2d263c 100644 +index 6761929..4d2b0a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -938,13 +938,17 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) +@@ -987,13 +987,17 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination}) diff --git a/ports/rocksdb/0003-use-find-package.patch b/ports/rocksdb/0003-use-find-package.patch index 47da318a1..e05de2a4b 100644 --- a/ports/rocksdb/0003-use-find-package.patch +++ b/ports/rocksdb/0003-use-find-package.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 36eddb32b..97a93601b 100644 +index 6761929..6f74d31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ include(CMakeDependentOption) @@ -23,7 +23,14 @@ index 36eddb32b..97a93601b 100644 add_definitions(-DSNAPPY) list(APPEND THIRDPARTY_LIBS Snappy::snappy) endif() -@@ -163,10 +160,9 @@ else() +@@ -157,16 +154,19 @@ else() + endif() + + if(WITH_LZ4) +- find_package(lz4 REQUIRED) ++ find_package(lz4 CONFIG REQUIRED) + add_definitions(-DLZ4) + list(APPEND THIRDPARTY_LIBS lz4::lz4) endif() if(WITH_ZSTD) @@ -32,7 +39,23 @@ index 36eddb32b..97a93601b 100644 add_definitions(-DZSTD) - include_directories(${ZSTD_INCLUDE_DIR}) - list(APPEND THIRDPARTY_LIBS zstd::zstd) -+ list(APPEND THIRDPARTY_LIBS libzstd) ++ if(TARGET zstd::libzstd_shared) ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared) ++ elseif(TARGET zstd::libzstd_static) ++ list(APPEND THIRDPARTY_LIBS zstd::libzstd_static) ++ endif() endif() endif() +@@ -375,9 +375,9 @@ endif() + + option(WITH_TBB "build with Threading Building Blocks (TBB)" OFF) + if(WITH_TBB) +- find_package(TBB REQUIRED) ++ find_package(TBB CONFIG REQUIRED) + add_definitions(-DTBB) +- list(APPEND THIRDPARTY_LIBS TBB::TBB) ++ list(APPEND THIRDPARTY_LIBS TBB::tbb) + endif() + + # Stall notifications eat some performance from inserts diff --git a/ports/rocksdb/0004-add-config-to-findpackage.patch b/ports/rocksdb/0004-add-config-to-findpackage.patch deleted file mode 100644 index 68df561e4..000000000 --- a/ports/rocksdb/0004-add-config-to-findpackage.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f9c8f3346..11aa70db9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -154,7 +154,7 @@ else() - endif() - - if(WITH_LZ4) -- find_package(lz4 REQUIRED) -+ find_package(lz4 CONFIG REQUIRED) - add_definitions(-DLZ4) - list(APPEND THIRDPARTY_LIBS lz4::lz4) - endif() diff --git a/ports/rocksdb/0004-fix-dependency-in-config.patch b/ports/rocksdb/0004-fix-dependency-in-config.patch new file mode 100644 index 000000000..a2cde0d7b --- /dev/null +++ b/ports/rocksdb/0004-fix-dependency-in-config.patch @@ -0,0 +1,22 @@ +diff --git a/cmake/RocksDBConfig.cmake.in b/cmake/RocksDBConfig.cmake.in +index 0bd14be..f9f6aa8 100644 +--- a/cmake/RocksDBConfig.cmake.in ++++ b/cmake/RocksDBConfig.cmake.in +@@ -37,7 +37,7 @@ if(@WITH_LZ4@) + endif() + + if(@WITH_ZSTD@) +- find_dependency(zstd) ++ find_dependency(zstd CONFIG) + endif() + + if(@WITH_NUMA@) +@@ -45,7 +45,7 @@ if(@WITH_NUMA@) + endif() + + if(@WITH_TBB@) +- find_dependency(TBB) ++ find_dependency(TBB CONFIG) + endif() + + find_dependency(Threads) diff --git a/ports/rocksdb/0005-backport-msvc-fixes-pr-7439.patch b/ports/rocksdb/0005-backport-msvc-fixes-pr-7439.patch deleted file mode 100644 index 7daedb27d..000000000 --- a/ports/rocksdb/0005-backport-msvc-fixes-pr-7439.patch +++ /dev/null @@ -1,256 +0,0 @@ -diff --git a/.circleci/config.yml b/.circleci/config.yml -index d656a1961..c088ee4ee 100644 ---- a/.circleci/config.yml -+++ b/.circleci/config.yml -@@ -234,7 +234,7 @@ jobs: - name: "Test RocksDB" - shell: powershell.exe - command: | -- build_tools\run_ci_db_test.ps1 -SuiteRun db_basic_test,db_test,db_test2,env_basic_test,env_test,db_merge_operand_test -Concurrency 16 -+ build_tools\run_ci_db_test.ps1 -SuiteRun db_basic_test,db_test,db_test2,db_merge_operand_test,bloom_test,c_test,coding_test,crc32c_test,dynamic_bloom_test,env_basic_test,env_test,hash_test,random_test -Concurrency 16 - - build-linux-java: - machine: -diff --git a/db/c_test.c b/db/c_test.c -index 4fb7d016d..a01336738 100644 ---- a/db/c_test.c -+++ b/db/c_test.c -@@ -58,7 +58,11 @@ static void StartPhase(const char* name) { - static const char* GetTempDir(void) { - const char* ret = getenv("TEST_TMPDIR"); - if (ret == NULL || ret[0] == '\0') -- ret = "/tmp"; -+#ifdef OS_WIN -+ ret = getenv("TEMP"); -+#else -+ ret = "/tmp"; -+#endif - return ret; - } - #ifdef _MSC_VER -diff --git a/db/perf_context_test.cc b/db/perf_context_test.cc -index 0410ada7a..5a714b9b8 100644 ---- a/db/perf_context_test.cc -+++ b/db/perf_context_test.cc -@@ -817,6 +817,13 @@ TEST_F(PerfContextTest, PerfContextByLevelGetSet) { - } - - TEST_F(PerfContextTest, CPUTimer) { -+ if (Env::Default()->NowCPUNanos() == 0) { -+ // TODO: This should be a GTEST_SKIP when the embedded gtest is updated -+ // to 1.10 or higher. -+ GTEST_SUCCESS_("Skipped on target without NowCPUNanos support"); -+ return; -+ } -+ - DestroyDB(kDbName, Options()); - auto db = OpenDb(); - WriteOptions write_options; -diff --git a/file/filename.cc b/file/filename.cc -index 968adbaa7..0ac4e6ef8 100644 ---- a/file/filename.cc -+++ b/file/filename.cc -@@ -461,8 +461,8 @@ Status GetInfoLogFiles(Env* env, const std::string& db_log_dir, - std::string NormalizePath(const std::string& path) { - std::string dst; - for (auto c : path) { -- if (!dst.empty() && c == kFilePathSeparator && -- dst.back() == kFilePathSeparator) { -+ if (!dst.empty() && (c == kFilePathSeparator || c == '/') && -+ (dst.back() == kFilePathSeparator || dst.back() == '/')) { - continue; - } - dst.push_back(c); -diff --git a/port/win/port_win.cc b/port/win/port_win.cc -index 2d99a7a9b..f33ee20c4 100644 ---- a/port/win/port_win.cc -+++ b/port/win/port_win.cc -@@ -100,6 +100,15 @@ bool CondVar::TimedWait(uint64_t abs_time_us) { - - // Caller must ensure that mutex is held prior to calling this method - std::unique_lock<std::mutex> lk(mu_->getLock(), std::adopt_lock); -+ -+ // Work around https://github.com/microsoft/STL/issues/369 -+#if defined(_MSC_VER) && \ -+ (!defined(_MSVC_STL_UPDATE) || _MSVC_STL_UPDATE < 202008L) -+ if (relTimeUs == microseconds::zero()) { -+ lk.unlock(); -+ lk.lock(); -+ } -+#endif - #ifndef NDEBUG - mu_->locked_ = false; - #endif -diff --git a/port/win/port_win.h b/port/win/port_win.h -index a3ffd559c..2c5b8ff05 100644 ---- a/port/win/port_win.h -+++ b/port/win/port_win.h -@@ -283,7 +283,7 @@ extern const size_t kPageSize; - #endif - - static inline void AsmVolatilePause() { --#if defined(_M_IX86) || defined(_M_X64) -+#if defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM64) || defined(_M_ARM) - YieldProcessor(); - #endif - // it would be nice to get "wfe" on ARM here -diff --git a/third-party/folly/folly/chrono/Hardware.h b/third-party/folly/folly/chrono/Hardware.h -index ec7be82e8..6635b8717 100644 ---- a/third-party/folly/folly/chrono/Hardware.h -+++ b/third-party/folly/folly/chrono/Hardware.h -@@ -10,7 +10,7 @@ - #include <chrono> - #include <cstdint> - --#if _MSC_VER -+#if _MSC_VER && (defined(_M_IX86) || defined(_M_X64)) - extern "C" std::uint64_t __rdtsc(); - #pragma intrinsic(__rdtsc) - #endif -@@ -18,7 +18,7 @@ extern "C" std::uint64_t __rdtsc(); - namespace folly { - - inline std::uint64_t hardware_timestamp() { --#if _MSC_VER -+#if _MSC_VER && (defined(_M_IX86) || defined(_M_X64)) - return __rdtsc(); - #elif __GNUC__ && (__i386__ || FOLLY_X64) - return __builtin_ia32_rdtsc(); -diff --git a/util/filelock_test.cc b/util/filelock_test.cc -index 611cd46c6..fe2f7e0d8 100644 ---- a/util/filelock_test.cc -+++ b/util/filelock_test.cc -@@ -127,9 +127,11 @@ TEST_F(LockTest, LockBySameThread) { - // re-acquire the lock on the same file. This should fail. - Status s = LockFile(&lock2); - ASSERT_TRUE(s.IsIOError()); -+#ifndef OS_WIN - // Validate that error message contains current thread ID. - ASSERT_TRUE(s.ToString().find(ToString(Env::Default()->GetThreadID())) != - std::string::npos); -+#endif - - // check the file is locked - ASSERT_TRUE( AssertFileIsLocked() ); -diff --git a/util/math.h b/util/math.h -index 2e57c1c08..24fc840e4 100644 ---- a/util/math.h -+++ b/util/math.h -@@ -21,13 +21,23 @@ inline int FloorLog2(T v) { - assert(v > 0); - #ifdef _MSC_VER - static_assert(sizeof(T) <= sizeof(uint64_t), "type too big"); -- unsigned long lz = 0; -+ unsigned long idx = 0; - if (sizeof(T) <= sizeof(uint32_t)) { -- _BitScanReverse(&lz, static_cast<uint32_t>(v)); -+ _BitScanReverse(&idx, static_cast<uint32_t>(v)); - } else { -- _BitScanReverse64(&lz, static_cast<uint64_t>(v)); -+#if defined(_M_X64) || defined(_M_ARM64) -+ _BitScanReverse64(&idx, static_cast<uint64_t>(v)); -+#else -+ const auto vh = static_cast<uint32_t>(static_cast<uint64_t>(v) >> 32); -+ if (vh != 0) { -+ _BitScanReverse(&idx, static_cast<uint32_t>(vh)); -+ idx += 32; -+ } else { -+ _BitScanReverse(&idx, static_cast<uint32_t>(v)); -+ } -+#endif - } -- return 63 - static_cast<int>(lz); -+ return idx; - #else - static_assert(sizeof(T) <= sizeof(unsigned long long), "type too big"); - if (sizeof(T) <= sizeof(unsigned int)) { -@@ -54,7 +64,16 @@ inline int CountTrailingZeroBits(T v) { - if (sizeof(T) <= sizeof(uint32_t)) { - _BitScanForward(&tz, static_cast<uint32_t>(v)); - } else { -+#if defined(_M_X64) || defined(_M_ARM64) - _BitScanForward64(&tz, static_cast<uint64_t>(v)); -+#else -+ _BitScanForward(&tz, static_cast<uint32_t>(v)); -+ if (tz == 0) { -+ _BitScanForward(&tz, -+ static_cast<uint32_t>(static_cast<uint64_t>(v) >> 32)); -+ tz += 32; -+ } -+#endif - } - return static_cast<int>(tz); - #else -@@ -69,6 +88,29 @@ inline int CountTrailingZeroBits(T v) { - #endif - } - -+#if defined(_MSC_VER) && !defined(_M_X64) -+namespace detail { -+template <typename T> -+int BitsSetToOneFallback(T v) { -+ const int kBits = static_cast<int>(sizeof(T)) * 8; -+ static_assert((kBits & (kBits - 1)) == 0, "must be power of two bits"); -+ // we static_cast these bit patterns in order to truncate them to the correct -+ // size -+ v = static_cast<T>(v - ((v >> 1) & static_cast<T>(0x5555555555555555ull))); -+ v = static_cast<T>((v & static_cast<T>(0x3333333333333333ull)) + -+ ((v >> 2) & static_cast<T>(0x3333333333333333ull))); -+ v = static_cast<T>((v + (v >> 4)) & static_cast<T>(0x0F0F0F0F0F0F0F0Full)); -+ for (int shift_bits = 8; shift_bits < kBits; shift_bits <<= 1) { -+ v += static_cast<T>(v >> shift_bits); -+ } -+ // we want the bottom "slot" that's big enough to represent a value up to -+ // (and including) kBits. -+ return static_cast<int>(v & static_cast<T>(kBits | (kBits - 1))); -+} -+ -+} // namespace detail -+#endif -+ - // Number of bits set to 1. Also known as "population count". - template <typename T> - inline int BitsSetToOne(T v) { -@@ -80,11 +122,27 @@ inline int BitsSetToOne(T v) { - constexpr auto mm = 8 * sizeof(uint32_t) - 1; - // The bit mask is to neutralize sign extension on small signed types - constexpr uint32_t m = (uint32_t{1} << ((8 * sizeof(T)) & mm)) - 1; -+#if defined(_M_X64) || defined(_M_IX86) - return static_cast<int>(__popcnt(static_cast<uint32_t>(v) & m)); -+#else -+ return static_cast<int>(detail::BitsSetToOneFallback(v) & m); -+#endif - } else if (sizeof(T) == sizeof(uint32_t)) { -+#if defined(_M_X64) || defined(_M_IX86) - return static_cast<int>(__popcnt(static_cast<uint32_t>(v))); -+#else -+ return detail::BitsSetToOneFallback(static_cast<uint32_t>(v)); -+#endif - } else { -+#ifdef _M_X64 - return static_cast<int>(__popcnt64(static_cast<uint64_t>(v))); -+#elif defined(_M_IX86) -+ return static_cast<int>( -+ __popcnt(static_cast<uint32_t>(static_cast<uint64_t>(v) >> 32) + -+ __popcnt(static_cast<uint32_t>(v)))); -+#else -+ return detail::BitsSetToOneFallback(static_cast<uint64_t>(v)); -+#endif - } - #else - static_assert(sizeof(T) <= sizeof(unsigned long long), "type too big"); -diff --git a/util/xxh3p.h b/util/xxh3p.h -index d1fc2bba2..05696cecd 100644 ---- a/util/xxh3p.h -+++ b/util/xxh3p.h -@@ -253,7 +253,9 @@ XXH_FORCE_INLINE U64x2 XXH_vec_mule(U32x4 a, U32x4 b) { - #if defined(XXH_NO_PREFETCH) - # define XXH_PREFETCH(ptr) (void)(ptr) /* disabled */ - #else --# if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_I86)) /* _mm_prefetch() is not defined outside of x86/x64 */ -+#if defined(_MSC_VER) && \ -+ (defined(_M_X64) || \ -+ defined(_M_IX86)) /* _mm_prefetch() is not defined outside of x86/x64 */ - # include <mmintrin.h> /* https://msdn.microsoft.com/fr-fr/library/84szxsww(v=vs.90).aspx */ - # define XXH_PREFETCH(ptr) _mm_prefetch((const char*)(ptr), _MM_HINT_T0) - # elif defined(__GNUC__) && ( (__GNUC__ >= 4) || ( (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1) ) ) diff --git a/ports/rocksdb/0005-do-not-install-cmake-modules.patch b/ports/rocksdb/0005-do-not-install-cmake-modules.patch new file mode 100644 index 000000000..6517537c0 --- /dev/null +++ b/ports/rocksdb/0005-do-not-install-cmake-modules.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ad4b711..b2061ae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -981,7 +981,7 @@ if(NOT WIN32 OR ROCKSDB_INSTALL_ON_WINDOWS) + + install(DIRECTORY include/rocksdb COMPONENT devel DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +- install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination}) ++ #install(DIRECTORY "${PROJECT_SOURCE_DIR}/cmake/modules" COMPONENT devel DESTINATION ${package_config_destination}) + + if(NOT ROCKSDB_BUILD_SHARED) + install( diff --git a/ports/rocksdb/CONTROL b/ports/rocksdb/CONTROL index 7d5474d9f..b63c6774e 100644 --- a/ports/rocksdb/CONTROL +++ b/ports/rocksdb/CONTROL @@ -1,5 +1,5 @@ Source: rocksdb -Version: 6.13.3 +Version: 6.14.6 Homepage: https://github.com/facebook/rocksdb Description: A library that provides an embeddable, persistent key-value store for fast storage Default-Features: zlib diff --git a/ports/rocksdb/portfile.cmake b/ports/rocksdb/portfile.cmake index 497b16655..80a47d317 100644 --- a/ports/rocksdb/portfile.cmake +++ b/ports/rocksdb/portfile.cmake @@ -3,15 +3,14 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO facebook/rocksdb - REF v6.13.3 - SHA512 9c1a9de2321d86a454e4fddc72965c55352902d4f55fc2e5bdc8cc5f081e8a2251a431c29c7a6108504456b148c4244a18bab2b261aaad9afcf290ae9cd5d724 + REF ed4316166f67ec892603014634840d29f460f611 # v6.14.6 + SHA512 a880a760f6f5a0a591c14fe942914a3ea85c387a901a922955bb2373ae903f96c6035cac8732d3000a3cbe6313016bfb21168bd3d8a7debf5a28c6e5c0aefb3f HEAD_REF master PATCHES - 0001-disable-gtest.patch 0002-only-build-one-flavor.patch 0003-use-find-package.patch - 0004-add-config-to-findpackage.patch - 0005-backport-msvc-fixes-pr-7439.patch # https://github.com/facebook/rocksdb/pull/7439 + 0004-fix-dependency-in-config.patch + 0005-do-not-install-cmake-modules.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "dynamic" WITH_MD_LIBRARY) @@ -33,22 +32,22 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DWITH_GFLAGS=OFF - -DWITH_TESTS=OFF - -DWITH_BENCHMARK_TOOLS=OFF - -DWITH_TOOLS=OFF - -DWITH_FOLLY_DISTRIBUTED_MUTEX=OFF - -DUSE_RTTI=1 - -DROCKSDB_INSTALL_ON_WINDOWS=ON - -DFAIL_ON_WARNINGS=OFF - -DWITH_MD_LIBRARY=${WITH_MD_LIBRARY} - -DPORTABLE=ON - -DCMAKE_DEBUG_POSTFIX=d - -DROCKSDB_BUILD_SHARED=${ROCKSDB_BUILD_SHARED} - -DCMAKE_DISABLE_FIND_PACKAGE_NUMA=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_gtest=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE - ${FEATURE_OPTIONS} + -DWITH_GFLAGS=OFF + -DWITH_TESTS=OFF + -DWITH_BENCHMARK_TOOLS=OFF + -DWITH_TOOLS=OFF + -DWITH_FOLLY_DISTRIBUTED_MUTEX=OFF + -DUSE_RTTI=1 + -DROCKSDB_INSTALL_ON_WINDOWS=ON + -DFAIL_ON_WARNINGS=OFF + -DWITH_MD_LIBRARY=${WITH_MD_LIBRARY} + -DPORTABLE=ON + -DCMAKE_DEBUG_POSTFIX=d + -DROCKSDB_BUILD_SHARED=${ROCKSDB_BUILD_SHARED} + -DCMAKE_DISABLE_FIND_PACKAGE_NUMA=TRUE + -DCMAKE_DISABLE_FIND_PACKAGE_gtest=TRUE + -DCMAKE_DISABLE_FIND_PACKAGE_Git=TRUE + ${FEATURE_OPTIONS} ) vcpkg_install_cmake() @@ -58,6 +57,6 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/rocksdb) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/LICENSE.Apache DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${SOURCE_PATH}/LICENSE.leveldb DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +file(INSTALL ${SOURCE_PATH}/LICENSE.leveldb DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") vcpkg_copy_pdbs() diff --git a/ports/rocksdb/vcpkg-cmake-wrapper.cmake b/ports/rocksdb/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 455facf22..000000000 --- a/ports/rocksdb/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,9 +0,0 @@ -_find_package(${ARGS})
-if(NOT TARGET RocksDB::rocksdb AND TARGET RocksDB::rocksdb-shared)
- add_library(RocksDB::rocksdb INTERFACE IMPORTED)
- set_target_properties(RocksDB::rocksdb PROPERTIES INTERFACE_LINK_LIBRARIES "RocksDB::rocksdb-shared")
-endif()
-if(TARGET RocksDB::rocksdb AND NOT TARGET RocksDB::rocksdb-shared)
- add_library(RocksDB::rocksdb-shared INTERFACE IMPORTED)
- set_target_properties(RocksDB::rocksdb-shared PROPERTIES INTERFACE_LINK_LIBRARIES "RocksDB::rocksdb")
-endif()
|
