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
91 lines
2.2 KiB
CMake
91 lines
2.2 KiB
CMake
find_package(cryptopp REQUIRED)
|
|
find_package(rapidxml REQUIRED)
|
|
find_package(GnuTLS 3.3.26 REQUIRED)
|
|
add_library(utils STATIC)
|
|
target_sources(utils
|
|
PRIVATE
|
|
UUID_gen.cc
|
|
alien_worker.cc
|
|
array-search.cc
|
|
ascii.cc
|
|
base64.cc
|
|
big_decimal.cc
|
|
bloom_calculations.cc
|
|
bloom_filter.cc
|
|
buffer_input_stream.cc
|
|
build_id.cc
|
|
config_file.cc
|
|
directories.cc
|
|
disk-error-handler.cc
|
|
disk_space_monitor.cc
|
|
dynamic_bitset.cc
|
|
error_injection.cc
|
|
exceptions.cc
|
|
file_lock.cc
|
|
gz/crc_combine.cc
|
|
gz/crc_combine_table.cc
|
|
hashers.cc
|
|
histogram_metrics_helper.cc
|
|
http.cc
|
|
human_readable.cc
|
|
i_filter.cc
|
|
io-wrappers.cc
|
|
large_bitset.cc
|
|
like_matcher.cc
|
|
limiting_data_source.cc
|
|
lister.cc
|
|
logalloc.cc
|
|
managed_bytes.cc
|
|
multiprecision_int.cc
|
|
murmur_hash.cc
|
|
on_internal_error.cc
|
|
pretty_printers.cc
|
|
rate_limiter.cc
|
|
rjson.cc
|
|
runtime.cc
|
|
to_string.cc
|
|
updateable_value.cc
|
|
utf8.cc
|
|
uuid.cc
|
|
labels.cc
|
|
aws_sigv4.cc
|
|
rest/client.cc
|
|
s3/aws_error.cc
|
|
s3/client.cc
|
|
s3/default_aws_retry_strategy.cc
|
|
s3/credentials_providers/aws_credentials_provider.cc
|
|
s3/credentials_providers/environment_aws_credentials_provider.cc
|
|
s3/credentials_providers/instance_profile_credentials_provider.cc
|
|
s3/credentials_providers/sts_assume_role_credentials_provider.cc
|
|
s3/credentials_providers/aws_credentials_provider_chain.cc
|
|
s3/utils/manip_s3.cc
|
|
azure/identity/credentials.cc
|
|
azure/identity/service_principal_credentials.cc
|
|
azure/identity/managed_identity_credentials.cc
|
|
azure/identity/azure_cli_credentials.cc
|
|
azure/identity/default_credentials.cc
|
|
gcp/gcp_credentials.cc
|
|
gcp/object_storage.cc
|
|
)
|
|
target_include_directories(utils
|
|
PUBLIC
|
|
${CMAKE_SOURCE_DIR}
|
|
${RAPIDJSON_INCLUDE_DIRS})
|
|
target_link_libraries(utils
|
|
PUBLIC
|
|
Seastar::seastar
|
|
xxHash::xxhash
|
|
PRIVATE
|
|
Boost::regex
|
|
crypto
|
|
cryptopp::cryptopp
|
|
rapidxml::rapidxml
|
|
yaml-cpp::yaml-cpp
|
|
GnuTLS::gnutls)
|
|
if (Scylla_USE_PRECOMPILED_HEADER_USE)
|
|
target_precompile_headers(utils REUSE_FROM scylla-precompiled-header)
|
|
endif()
|
|
|
|
check_headers(check-headers utils
|
|
GLOB_RECURSE ${CMAKE_CURRENT_SOURCE_DIR}/*.hh)
|