Files
scylladb/sstables/CMakeLists.txt
Radosław Cybulski d589e68642 Add precompiled headers to CMakeLists.txt
Add precompiled header support to CMakeLists.txt and configure.py -
it improves compilation time by approximately 10%.

New header `stdafx.hh` is added, don't include it manually -
the compiler will include it for you. The header contains includes from
external libraries used by Scylla - seastar, standard library,
linux headers and zlib.

The feature is enabled by default, use CMake option `Scylla_USE_PRECOMPILED_HEADER`
or configure.py --disable-precompiled-header to disable.

The feature should be disabled, when trying to check headers - otherwise
you might get false negatives on missing includes from seastar / abseil and so on.

Note: following configuration needs to be added to ccache.conf:

    sloppiness = pch_defines,time_macros,include_file_mtime,include_file_ctime

Closes scylladb/scylladb#26617
2025-11-21 12:27:41 +02:00

53 lines
1.2 KiB
CMake

add_library(sstables STATIC)
target_sources(sstables
PRIVATE
compress.cc
compressor.cc
checksummed_data_source.cc
integrity_checked_file_impl.cc
kl/reader.cc
metadata_collector.cc
m_format_read_helpers.cc
mx/partition_reversing_data_source.cc
mx/reader.cc
mx/writer.cc
object_storage_client.cc
prepended_input_stream.cc
random_access_reader.cc
sstable_directory.cc
sstable_mutation_reader.cc
sstables.cc
sstable_set.cc
sstables_manager.cc
sstable_version.cc
storage.cc
trie/bti_key_translation.cc
trie/bti_index_reader.cc
trie/bti_node_reader.cc
trie/bti_node_sink.cc
trie/bti_partition_index_writer.cc
trie/bti_row_index_writer.cc
trie/trie_writer.cc
writer.cc)
target_include_directories(sstables
PUBLIC
${CMAKE_SOURCE_DIR})
target_link_libraries(sstables
PUBLIC
idl
wasmtime_bindings
Seastar::seastar
xxHash::xxhash
PRIVATE
readers
tracing
absl::headers
libdeflate::libdeflate
ZLIB::ZLIB)
if (Scylla_USE_PRECOMPILED_HEADER_USE)
target_precompile_headers(sstables REUSE_FROM scylla-precompiled-header)
endif()
check_headers(check-headers sstables
GLOB_RECURSE ${CMAKE_CURRENT_SOURCE_DIR}/*.hh)