mirror of https://github.com/microsoft/vcpkg.git
[vcpkg-ci-rocksdb] New ci port (#52331)
This commit is contained in:
parent
cfd0ea018f
commit
7f39fde22e
|
|
@ -0,0 +1,6 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
|
|
@ -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)
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue