Merge pull request #46088 from ClickHouse/rs/fix-liburing-build

Fix build with `-DENABLE_LIBURING=0` (or `-DENABLE_LIBRARIES=0`)
This commit is contained in:
Robert Schulze 2023-02-07 12:16:14 +01:00 committed by GitHub
commit 690d873126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 5 deletions

View File

@ -29,6 +29,7 @@
#cmakedefine01 USE_FASTOPS
#cmakedefine01 USE_NLP
#cmakedefine01 USE_VECTORSCAN
#cmakedefine01 USE_LIBURING
#cmakedefine01 USE_AVRO
#cmakedefine01 USE_CAPNP
#cmakedefine01 USE_PARQUET

View File

@ -1,6 +1,7 @@
#if defined(OS_LINUX)
#include "IOUringReader.h"
#if USE_LIBURING
#include <base/errnoToString.h>
#include <Common/assert_cast.h>
#include <Common/Exception.h>

View File

@ -1,5 +1,8 @@
#pragma once
#if defined(OS_LINUX)
#include "config.h"
#if USE_LIBURING
#include <Common/ThreadPool.h>
#include <IO/AsynchronousReader.h>

View File

@ -7,7 +7,7 @@
#include <Disks/IO/ThreadPoolReader.h>
#include <IO/SynchronousReader.h>
#include <Common/ProfileEvents.h>
#include "config.h"
namespace ProfileEvents
{
@ -84,7 +84,7 @@ std::unique_ptr<ReadBufferFromFileBase> createReadBufferFromFileBase(
}
else if (settings.local_fs_method == LocalFSReadMethod::io_uring)
{
#if defined(OS_LINUX)
#if USE_LIBURING
static std::shared_ptr<IOUringReader> reader = std::make_shared<IOUringReader>(512);
if (!reader->isSupported())
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "io_uring is not supported by this system");

View File

@ -51,6 +51,7 @@ const char * auto_config_build[]
"USE_ROCKSDB", "@USE_ROCKSDB@",
"USE_NURAFT", "@USE_NURAFT@",
"USE_NLP", "@USE_NLP@",
"USE_LIBURING", "@USE_LIBURING@",
"USE_SQLITE", "@USE_SQLITE@",
"USE_LIBPQXX", "@USE_LIBPQXX@",
"USE_AZURE_BLOB_STORAGE", "@USE_AZURE_BLOB_STORAGE@",

View File

@ -129,6 +129,9 @@ if (TARGET ch_contrib::parquet)
set(USE_ARROW 1)
set(USE_ORC 1)
endif()
if (TARGET ch_contrib::liburing)
set(USE_LIBURING 1)
endif ()
if (TARGET ch_contrib::protobuf)
set(USE_PROTOBUF 1)
endif()