[vcpkg-ci-rocksdb] New ci port (#52331)

This commit is contained in:
Weihang Ding 2026-06-13 06:40:11 +08:00 committed by GitHub
parent cfd0ea018f
commit 7f39fde22e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,6 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
vcpkg_cmake_configure(
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
)
vcpkg_cmake_build()

View File

@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.16)
project(vcpkg-ci-rocksdb)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(RocksDB CONFIG REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE RocksDB::rocksdb)

View File

@ -0,0 +1,23 @@
#include <rocksdb/db.h>
#include <cassert>
#include <string>
#include <filesystem>
#include <memory>
int main() {
std::filesystem::path tmp = std::filesystem::temp_directory_path() / "vcpkg-ci-rocksdb-test";
std::filesystem::remove_all(tmp);
std::unique_ptr<rocksdb::DB> db;
rocksdb::Options options;
options.create_if_missing = true;
rocksdb::Status status = rocksdb::DB::Open(options, tmp.string(), &db);
assert(status.ok());
status = db->Put(rocksdb::WriteOptions(), "hello", "rocksdb");
assert(status.ok());
std::string value;
status = db->Get(rocksdb::ReadOptions(), "hello", &value);
assert(status.ok());
assert(value == "rocksdb");
std::filesystem::remove_all(tmp);
return 0;
}

View File

@ -0,0 +1,24 @@
{
"name": "vcpkg-ci-rocksdb",
"version-string": "ci",
"description": "Validates rocksdb",
"dependencies": [
{
"name": "rocksdb",
"features": [
"bzip2",
"liburing",
"lz4",
"numa",
"snappy",
"tbb",
"zlib",
"zstd"
]
},
{
"name": "vcpkg-cmake",
"host": true
}
]
}