From 2d44fa59b5d4c9fda50d8c40428ce003b8fe62aa Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Fri, 14 Feb 2020 17:48:30 +0300 Subject: [PATCH 1/4] =?UTF-8?q?libs/=20=E2=86=92=20base/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 8 +- {libs => base}/CMakeLists.txt | 14 +- base/common/CMakeLists.txt | 85 ++++++++++++ .../libcommon/src => base/common}/DateLUT.cpp | 0 .../include => base}/common/DateLUT.h | 0 .../src => base/common}/DateLUTImpl.cpp | 0 .../include => base}/common/DateLUTImpl.h | 0 .../include => base}/common/DayNum.h | 0 .../include => base}/common/ErrorHandlers.h | 0 {libs/libcommon/src => base/common}/JSON.cpp | 0 .../libcommon/include => base}/common/JSON.h | 0 .../src => base/common}/LineReader.cpp | 0 .../include => base}/common/LineReader.h | 0 .../include => base}/common/LocalDate.h | 0 .../include => base}/common/LocalDateTime.h | 0 .../src => base/common}/ReplxxLineReader.cpp | 0 .../common/ReplxxLineReader.h | 0 .../include => base}/common/SimpleCache.h | 0 .../include => base}/common/StringRef.h | 0 .../libcommon/include => base}/common/Types.h | 0 .../src => base/common}/apple_rt.cpp | 0 .../src => base/common}/argsToConfig.cpp | 0 .../include => base}/common/argsToConfig.h | 0 .../common/arithmeticOverflow.h | 0 .../common/config_common.h.in | 0 .../common/constexpr_helpers.h | 0 .../src => base/common}/coverage.cpp | 0 .../include => base}/common/coverage.h | 0 .../src => base/common}/demangle.cpp | 0 .../include => base}/common/demangle.h | 0 .../include => base}/common/find_symbols.h | 0 .../src => base/common}/getMemoryAmount.cpp | 0 .../include => base}/common/getMemoryAmount.h | 0 .../src => base/common}/getThreadId.cpp | 0 .../include => base}/common/getThreadId.h | 0 .../common/iostream_debug_helpers.h | 0 .../libcommon/include => base}/common/itoa.h | 0 .../include => base}/common/likely.h | 0 .../include => base}/common/logger_useful.h | 0 .../include => base}/common/memory.h | 0 .../libcommon/src => base/common}/mremap.cpp | 0 .../include => base}/common/mremap.h | 0 .../src => base/common}/phdr_cache.cpp | 0 .../include => base}/common/phdr_cache.h | 0 .../src => base/common}/preciseExp10.c | 0 .../include => base}/common/preciseExp10.h | 0 .../src => base/common}/setTerminalEcho.cpp | 0 .../include => base}/common/setTerminalEcho.h | 0 .../libcommon/src => base/common}/shift10.cpp | 0 .../include => base}/common/shift10.h | 0 {libs/libcommon/src => base/common}/sleep.cpp | 0 .../libcommon/include => base}/common/sleep.h | 0 .../include => base}/common/strong_typedef.h | 0 .../src => base/common}/tests/CMakeLists.txt | 0 .../src => base/common}/tests/allocator.cpp | 0 .../src => base/common}/tests/date_lut2.cpp | 0 .../src => base/common}/tests/date_lut3.cpp | 0 .../src => base/common}/tests/date_lut4.cpp | 0 .../tests/date_lut_default_timezone.cpp | 0 .../common}/tests/date_lut_init.cpp | 0 .../common}/tests/dump_variable.cpp | 0 .../common}/tests/gtest_find_symbols.cpp | 0 .../common}/tests/gtest_json_test.cpp | 0 .../common}/tests/gtest_strong_typedef.cpp | 0 .../tests/local_date_time_comparison.cpp | 0 .../include => base}/common/unaligned.h | 0 .../consistent-hashing-sumbur/CMakeLists.txt | 0 .../consistent-hashing-sumbur/sumbur.cpp | 0 .../consistent-hashing-sumbur/sumbur.h | 0 .../consistent-hashing/CMakeLists.txt | 0 {libs => base}/consistent-hashing/bitops.h | 0 .../consistent-hashing/consistent_hashing.cpp | 0 .../consistent-hashing/consistent_hashing.h | 0 .../consistent-hashing/popcount.cpp | 0 {libs => base}/consistent-hashing/popcount.h | 0 .../libdaemon => base/daemon}/CMakeLists.txt | 0 .../daemon}/include/daemon/BaseDaemon.h | 0 .../daemon}/include/daemon/GraphiteWriter.h | 0 .../daemon}/src/BaseDaemon.cpp | 0 .../daemon}/src/GraphiteWriter.cpp | 0 .../libcommon/include => base}/ext/bit_cast.h | 0 .../include => base}/ext/chrono_io.h | 0 .../include => base}/ext/collection_cast.h | 0 .../include => base}/ext/enumerate.h | 0 .../include => base}/ext/function_traits.h | 0 .../libcommon/include => base}/ext/identity.h | 0 .../include => base}/ext/make_array_n.h | 0 {libs/libcommon/include => base}/ext/map.h | 0 .../include => base}/ext/push_back.h | 0 {libs/libcommon/include => base}/ext/range.h | 0 .../include => base}/ext/scope_guard.h | 0 .../include => base}/ext/shared_ptr_helper.h | 0 .../include => base}/ext/singleton.h | 0 {libs/libcommon/include => base}/ext/size.h | 0 .../include => base}/ext/unlock_guard.h | 0 .../glibc-compatibility}/CMakeLists.txt | 0 .../glibc-compatibility.c | 0 .../glibc-compatibility}/musl/COPYRIGHT | 0 .../glibc-compatibility}/musl/README | 0 .../musl/__math_divzero.c | 0 .../musl/__math_divzerof.c | 0 .../musl/__math_invalid.c | 0 .../musl/__math_invalidf.c | 0 .../glibc-compatibility}/musl/__math_oflow.c | 0 .../glibc-compatibility}/musl/__math_oflowf.c | 0 .../glibc-compatibility}/musl/__math_uflow.c | 0 .../glibc-compatibility}/musl/__math_uflowf.c | 0 .../glibc-compatibility}/musl/__math_xflow.c | 0 .../glibc-compatibility}/musl/__math_xflowf.c | 0 .../musl/aarch64/atomic_arch.h | 0 .../musl/aarch64/longjmp.s | 0 .../musl/aarch64/syscall.s | 0 .../musl/aarch64/syscall_arch.h | 0 .../glibc-compatibility}/musl/atomic.h | 0 .../glibc-compatibility}/musl/clock_gettime.c | 0 .../musl/clock_nanosleep.c | 0 .../glibc-compatibility}/musl/exp.c | 0 .../glibc-compatibility}/musl/exp2.c | 0 .../glibc-compatibility}/musl/exp2f.c | 0 .../glibc-compatibility}/musl/exp2f_data.c | 0 .../glibc-compatibility}/musl/exp2f_data.h | 0 .../glibc-compatibility}/musl/exp_data.c | 0 .../glibc-compatibility}/musl/exp_data.h | 0 .../glibc-compatibility}/musl/fallocate.c | 0 .../glibc-compatibility}/musl/fcntl.c | 0 .../glibc-compatibility}/musl/futimens.c | 0 .../glibc-compatibility}/musl/getentropy.c | 0 .../glibc-compatibility}/musl/getrandom.c | 0 .../glibc-compatibility}/musl/glob.c | 0 .../glibc-compatibility}/musl/lgamma.c | 0 .../glibc-compatibility}/musl/libm.h | 0 .../glibc-compatibility}/musl/log.c | 0 .../glibc-compatibility}/musl/log2.c | 0 .../glibc-compatibility}/musl/log2_data.c | 0 .../glibc-compatibility}/musl/log2_data.h | 0 .../glibc-compatibility}/musl/log2f.c | 0 .../glibc-compatibility}/musl/log2f_data.c | 0 .../glibc-compatibility}/musl/log2f_data.h | 0 .../glibc-compatibility}/musl/log_data.c | 0 .../glibc-compatibility}/musl/log_data.h | 0 .../glibc-compatibility}/musl/logf.c | 0 .../glibc-compatibility}/musl/logf_data.c | 0 .../glibc-compatibility}/musl/logf_data.h | 0 .../glibc-compatibility}/musl/musl_features.h | 0 .../glibc-compatibility}/musl/pipe2.c | 0 .../glibc-compatibility}/musl/posix_spawn.c | 0 .../glibc-compatibility}/musl/pow.c | 0 .../glibc-compatibility}/musl/pow_data.c | 0 .../glibc-compatibility}/musl/pow_data.h | 0 .../glibc-compatibility}/musl/pwritev.c | 0 .../musl/sched_cpucount.c | 0 .../glibc-compatibility}/musl/sched_getcpu.c | 0 .../glibc-compatibility}/musl/syscall.h | 0 .../glibc-compatibility}/musl/syscall_ret.c | 0 .../glibc-compatibility}/musl/timespec_get.c | 0 .../glibc-compatibility}/musl/utimensat.c | 0 .../glibc-compatibility}/musl/vasprintf.c | 0 .../glibc-compatibility}/musl/vdso.c | 0 .../musl/x86_64/atomic_arch.h | 0 .../musl/x86_64/longjmp.s | 0 .../musl/x86_64/syscall.s | 0 .../musl/x86_64/syscall_arch.h | 0 .../loggers}/CMakeLists.txt | 0 .../loggers}/loggers/CMakeLists.txt | 0 .../loggers}/loggers/ExtendedLogChannel.cpp | 0 .../loggers}/loggers/ExtendedLogChannel.h | 0 .../loggers}/loggers/Loggers.cpp | 0 .../loggers}/loggers/Loggers.h | 0 .../loggers}/loggers/OwnFormattingChannel.cpp | 0 .../loggers}/loggers/OwnFormattingChannel.h | 0 .../loggers}/loggers/OwnPatternFormatter.cpp | 0 .../loggers}/loggers/OwnPatternFormatter.h | 0 .../loggers}/loggers/OwnSplitChannel.cpp | 0 .../loggers}/loggers/OwnSplitChannel.h | 0 .../libmemcpy => base/memcpy}/CMakeLists.txt | 0 {libs/libmemcpy => base/memcpy}/README.md | 0 .../memcpy}/impl/FastMemcpy.h | 0 {libs/libmemcpy => base/memcpy}/impl/LICENSE | 0 .../libmemcpy => base/memcpy}/impl/README.md | 0 {libs/libmemcpy => base/memcpy}/memcpy.c | 0 {libs/libmemcpy => base/memcpy}/memcpy.h | 0 .../mysqlxx}/CMakeLists.txt | 0 .../mysqlxx}/include/mysqlxx/Connection.h | 0 .../mysqlxx}/include/mysqlxx/Exception.h | 0 .../mysqlxx}/include/mysqlxx/Null.h | 0 .../mysqlxx}/include/mysqlxx/Pool.h | 0 .../include/mysqlxx/PoolWithFailover.h | 0 .../mysqlxx}/include/mysqlxx/Query.h | 0 .../mysqlxx}/include/mysqlxx/ResultBase.h | 0 .../mysqlxx}/include/mysqlxx/Row.h | 0 .../include/mysqlxx/StoreQueryResult.h | 0 .../mysqlxx}/include/mysqlxx/Transaction.h | 0 .../mysqlxx}/include/mysqlxx/Types.h | 0 .../mysqlxx}/include/mysqlxx/UseQueryResult.h | 0 .../mysqlxx}/include/mysqlxx/Value.h | 0 .../mysqlxx}/include/mysqlxx/mysqlxx.h | 0 .../mysqlxx}/src/Connection.cpp | 0 .../mysqlxx}/src/Exception.cpp | 0 .../libmysqlxx => base/mysqlxx}/src/Pool.cpp | 0 .../mysqlxx}/src/PoolWithFailover.cpp | 0 .../libmysqlxx => base/mysqlxx}/src/Query.cpp | 0 .../mysqlxx}/src/ResultBase.cpp | 0 {libs/libmysqlxx => base/mysqlxx}/src/Row.cpp | 0 .../mysqlxx}/src/StoreQueryResult.cpp | 0 .../mysqlxx}/src/UseQueryResult.cpp | 0 .../libmysqlxx => base/mysqlxx}/src/Value.cpp | 0 .../mysqlxx}/src/tests/CMakeLists.txt | 0 .../mysqlxx}/src/tests/failover.xml | 0 .../mysqlxx}/src/tests/mysqlxx_test.cpp | 0 {libs/libcommon/include => base}/port/clock.h | 0 .../libcommon/include => base}/port/ssize_t.h | 0 .../libcommon/include => base}/port/unistd.h | 0 .../widechar_width}/CMakeLists.txt | 0 .../widechar_width}/LICENSE | 0 .../widechar_width}/README.md | 0 .../widechar_width}/widechar_width.cpp | 0 .../widechar_width}/widechar_width.h | 0 .../find_cctz.cmake => cmake/find/cctz.cmake | 0 .../find/jemalloc.cmake | 0 .../find/mysqlclient.cmake | 0 cmake/lib_name.cmake | 2 +- cmake/linux/default_libs.cmake | 2 +- libs/libcommon/CMakeLists.txt | 128 ------------------ 223 files changed, 98 insertions(+), 141 deletions(-) rename {libs => base}/CMakeLists.txt (62%) create mode 100644 base/common/CMakeLists.txt rename {libs/libcommon/src => base/common}/DateLUT.cpp (100%) rename {libs/libcommon/include => base}/common/DateLUT.h (100%) rename {libs/libcommon/src => base/common}/DateLUTImpl.cpp (100%) rename {libs/libcommon/include => base}/common/DateLUTImpl.h (100%) rename {libs/libcommon/include => base}/common/DayNum.h (100%) rename {libs/libcommon/include => base}/common/ErrorHandlers.h (100%) rename {libs/libcommon/src => base/common}/JSON.cpp (100%) rename {libs/libcommon/include => base}/common/JSON.h (100%) rename {libs/libcommon/src => base/common}/LineReader.cpp (100%) rename {libs/libcommon/include => base}/common/LineReader.h (100%) rename {libs/libcommon/include => base}/common/LocalDate.h (100%) rename {libs/libcommon/include => base}/common/LocalDateTime.h (100%) rename {libs/libcommon/src => base/common}/ReplxxLineReader.cpp (100%) rename {libs/libcommon/include => base}/common/ReplxxLineReader.h (100%) rename {libs/libcommon/include => base}/common/SimpleCache.h (100%) rename {libs/libcommon/include => base}/common/StringRef.h (100%) rename {libs/libcommon/include => base}/common/Types.h (100%) rename {libs/libcommon/src => base/common}/apple_rt.cpp (100%) rename {libs/libcommon/src => base/common}/argsToConfig.cpp (100%) rename {libs/libcommon/include => base}/common/argsToConfig.h (100%) rename {libs/libcommon/include => base}/common/arithmeticOverflow.h (100%) rename {libs/libcommon/include => base}/common/config_common.h.in (100%) rename {libs/libcommon/include => base}/common/constexpr_helpers.h (100%) rename {libs/libcommon/src => base/common}/coverage.cpp (100%) rename {libs/libcommon/include => base}/common/coverage.h (100%) rename {libs/libcommon/src => base/common}/demangle.cpp (100%) rename {libs/libcommon/include => base}/common/demangle.h (100%) rename {libs/libcommon/include => base}/common/find_symbols.h (100%) rename {libs/libcommon/src => base/common}/getMemoryAmount.cpp (100%) rename {libs/libcommon/include => base}/common/getMemoryAmount.h (100%) rename {libs/libcommon/src => base/common}/getThreadId.cpp (100%) rename {libs/libcommon/include => base}/common/getThreadId.h (100%) rename {libs/libcommon/include => base}/common/iostream_debug_helpers.h (100%) rename {libs/libcommon/include => base}/common/itoa.h (100%) rename {libs/libcommon/include => base}/common/likely.h (100%) rename {libs/libcommon/include => base}/common/logger_useful.h (100%) rename {libs/libcommon/include => base}/common/memory.h (100%) rename {libs/libcommon/src => base/common}/mremap.cpp (100%) rename {libs/libcommon/include => base}/common/mremap.h (100%) rename {libs/libcommon/src => base/common}/phdr_cache.cpp (100%) rename {libs/libcommon/include => base}/common/phdr_cache.h (100%) rename {libs/libcommon/src => base/common}/preciseExp10.c (100%) rename {libs/libcommon/include => base}/common/preciseExp10.h (100%) rename {libs/libcommon/src => base/common}/setTerminalEcho.cpp (100%) rename {libs/libcommon/include => base}/common/setTerminalEcho.h (100%) rename {libs/libcommon/src => base/common}/shift10.cpp (100%) rename {libs/libcommon/include => base}/common/shift10.h (100%) rename {libs/libcommon/src => base/common}/sleep.cpp (100%) rename {libs/libcommon/include => base}/common/sleep.h (100%) rename {libs/libcommon/include => base}/common/strong_typedef.h (100%) rename {libs/libcommon/src => base/common}/tests/CMakeLists.txt (100%) rename {libs/libcommon/src => base/common}/tests/allocator.cpp (100%) rename {libs/libcommon/src => base/common}/tests/date_lut2.cpp (100%) rename {libs/libcommon/src => base/common}/tests/date_lut3.cpp (100%) rename {libs/libcommon/src => base/common}/tests/date_lut4.cpp (100%) rename {libs/libcommon/src => base/common}/tests/date_lut_default_timezone.cpp (100%) rename {libs/libcommon/src => base/common}/tests/date_lut_init.cpp (100%) rename {libs/libcommon/src => base/common}/tests/dump_variable.cpp (100%) rename {libs/libcommon/src => base/common}/tests/gtest_find_symbols.cpp (100%) rename {libs/libcommon/src => base/common}/tests/gtest_json_test.cpp (100%) rename {libs/libcommon/src => base/common}/tests/gtest_strong_typedef.cpp (100%) rename {libs/libcommon/src => base/common}/tests/local_date_time_comparison.cpp (100%) rename {libs/libcommon/include => base}/common/unaligned.h (100%) rename {libs => base}/consistent-hashing-sumbur/CMakeLists.txt (100%) rename {libs => base}/consistent-hashing-sumbur/sumbur.cpp (100%) rename {libs => base}/consistent-hashing-sumbur/sumbur.h (100%) rename {libs => base}/consistent-hashing/CMakeLists.txt (100%) rename {libs => base}/consistent-hashing/bitops.h (100%) rename {libs => base}/consistent-hashing/consistent_hashing.cpp (100%) rename {libs => base}/consistent-hashing/consistent_hashing.h (100%) rename {libs => base}/consistent-hashing/popcount.cpp (100%) rename {libs => base}/consistent-hashing/popcount.h (100%) rename {libs/libdaemon => base/daemon}/CMakeLists.txt (100%) rename {libs/libdaemon => base/daemon}/include/daemon/BaseDaemon.h (100%) rename {libs/libdaemon => base/daemon}/include/daemon/GraphiteWriter.h (100%) rename {libs/libdaemon => base/daemon}/src/BaseDaemon.cpp (100%) rename {libs/libdaemon => base/daemon}/src/GraphiteWriter.cpp (100%) rename {libs/libcommon/include => base}/ext/bit_cast.h (100%) rename {libs/libcommon/include => base}/ext/chrono_io.h (100%) rename {libs/libcommon/include => base}/ext/collection_cast.h (100%) rename {libs/libcommon/include => base}/ext/enumerate.h (100%) rename {libs/libcommon/include => base}/ext/function_traits.h (100%) rename {libs/libcommon/include => base}/ext/identity.h (100%) rename {libs/libcommon/include => base}/ext/make_array_n.h (100%) rename {libs/libcommon/include => base}/ext/map.h (100%) rename {libs/libcommon/include => base}/ext/push_back.h (100%) rename {libs/libcommon/include => base}/ext/range.h (100%) rename {libs/libcommon/include => base}/ext/scope_guard.h (100%) rename {libs/libcommon/include => base}/ext/shared_ptr_helper.h (100%) rename {libs/libcommon/include => base}/ext/singleton.h (100%) rename {libs/libcommon/include => base}/ext/size.h (100%) rename {libs/libcommon/include => base}/ext/unlock_guard.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/CMakeLists.txt (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/glibc-compatibility.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/COPYRIGHT (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/README (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_divzero.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_divzerof.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_invalid.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_invalidf.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_oflow.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_oflowf.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_uflow.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_uflowf.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_xflow.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/__math_xflowf.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/aarch64/atomic_arch.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/aarch64/longjmp.s (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/aarch64/syscall.s (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/aarch64/syscall_arch.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/atomic.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/clock_gettime.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/clock_nanosleep.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/exp.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/exp2.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/exp2f.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/exp2f_data.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/exp2f_data.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/exp_data.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/exp_data.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/fallocate.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/fcntl.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/futimens.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/getentropy.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/getrandom.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/glob.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/lgamma.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/libm.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log2.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log2_data.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log2_data.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log2f.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log2f_data.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log2f_data.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log_data.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/log_data.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/logf.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/logf_data.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/logf_data.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/musl_features.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/pipe2.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/posix_spawn.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/pow.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/pow_data.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/pow_data.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/pwritev.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/sched_cpucount.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/sched_getcpu.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/syscall.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/syscall_ret.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/timespec_get.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/utimensat.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/vasprintf.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/vdso.c (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/x86_64/atomic_arch.h (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/x86_64/longjmp.s (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/x86_64/syscall.s (100%) rename {libs/libglibc-compatibility => base/glibc-compatibility}/musl/x86_64/syscall_arch.h (100%) rename {libs/libloggers => base/loggers}/CMakeLists.txt (100%) rename {libs/libloggers => base/loggers}/loggers/CMakeLists.txt (100%) rename {libs/libloggers => base/loggers}/loggers/ExtendedLogChannel.cpp (100%) rename {libs/libloggers => base/loggers}/loggers/ExtendedLogChannel.h (100%) rename {libs/libloggers => base/loggers}/loggers/Loggers.cpp (100%) rename {libs/libloggers => base/loggers}/loggers/Loggers.h (100%) rename {libs/libloggers => base/loggers}/loggers/OwnFormattingChannel.cpp (100%) rename {libs/libloggers => base/loggers}/loggers/OwnFormattingChannel.h (100%) rename {libs/libloggers => base/loggers}/loggers/OwnPatternFormatter.cpp (100%) rename {libs/libloggers => base/loggers}/loggers/OwnPatternFormatter.h (100%) rename {libs/libloggers => base/loggers}/loggers/OwnSplitChannel.cpp (100%) rename {libs/libloggers => base/loggers}/loggers/OwnSplitChannel.h (100%) rename {libs/libmemcpy => base/memcpy}/CMakeLists.txt (100%) rename {libs/libmemcpy => base/memcpy}/README.md (100%) rename {libs/libmemcpy => base/memcpy}/impl/FastMemcpy.h (100%) rename {libs/libmemcpy => base/memcpy}/impl/LICENSE (100%) rename {libs/libmemcpy => base/memcpy}/impl/README.md (100%) rename {libs/libmemcpy => base/memcpy}/memcpy.c (100%) rename {libs/libmemcpy => base/memcpy}/memcpy.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/CMakeLists.txt (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Connection.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Exception.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Null.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Pool.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/PoolWithFailover.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Query.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/ResultBase.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Row.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/StoreQueryResult.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Transaction.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Types.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/UseQueryResult.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/Value.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/include/mysqlxx/mysqlxx.h (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/Connection.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/Exception.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/Pool.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/PoolWithFailover.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/Query.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/ResultBase.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/Row.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/StoreQueryResult.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/UseQueryResult.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/Value.cpp (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/tests/CMakeLists.txt (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/tests/failover.xml (100%) rename {libs/libmysqlxx => base/mysqlxx}/src/tests/mysqlxx_test.cpp (100%) rename {libs/libcommon/include => base}/port/clock.h (100%) rename {libs/libcommon/include => base}/port/ssize_t.h (100%) rename {libs/libcommon/include => base}/port/unistd.h (100%) rename {libs/libwidechar_width => base/widechar_width}/CMakeLists.txt (100%) rename {libs/libwidechar_width => base/widechar_width}/LICENSE (100%) rename {libs/libwidechar_width => base/widechar_width}/README.md (100%) rename {libs/libwidechar_width => base/widechar_width}/widechar_width.cpp (100%) rename {libs/libwidechar_width => base/widechar_width}/widechar_width.h (100%) rename libs/libcommon/cmake/find_cctz.cmake => cmake/find/cctz.cmake (100%) rename libs/libcommon/cmake/find_jemalloc.cmake => cmake/find/jemalloc.cmake (100%) rename libs/libmysqlxx/cmake/find_mysqlclient.cmake => cmake/find/mysqlclient.cmake (100%) delete mode 100644 libs/libcommon/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index c194ea5bdc7..6bd77cb1fcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,9 +364,9 @@ if (ENABLE_TESTS) endif () # Need to process before "contrib" dir: -include (libs/libcommon/cmake/find_jemalloc.cmake) -include (libs/libcommon/cmake/find_cctz.cmake) -include (libs/libmysqlxx/cmake/find_mysqlclient.cmake) +include (cmake/find/jemalloc.cmake) +include (cmake/find/cctz.cmake) +include (cmake/find/mysqlclient.cmake) # When testing for memory leaks with Valgrind, don't link tcmalloc or jemalloc. @@ -398,7 +398,7 @@ macro (add_executable target) endif() endmacro() -add_subdirectory (libs) +add_subdirectory (base) add_subdirectory (utils) add_subdirectory (dbms) diff --git a/libs/CMakeLists.txt b/base/CMakeLists.txt similarity index 62% rename from libs/CMakeLists.txt rename to base/CMakeLists.txt index b5bcbd804be..4cc9cb51670 100644 --- a/libs/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -4,23 +4,23 @@ if (NOT NO_WERROR) endif () if (USE_DEBUG_HELPERS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/libcommon/include/common/iostream_debug_helpers.h") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/common/iostream_debug_helpers.h") endif () -add_subdirectory (libcommon) -add_subdirectory (libloggers) -add_subdirectory (libdaemon) +add_subdirectory (common) +add_subdirectory (loggers) +add_subdirectory (daemon) if (USE_INTERNAL_MEMCPY) - add_subdirectory (libmemcpy) + add_subdirectory (memcpy) endif() if (USE_MYSQL) - add_subdirectory (libmysqlxx) + add_subdirectory (mysqlxx) endif () if (USE_INTERNAL_CONSISTENT_HASHING_LIBRARY) add_subdirectory (consistent-hashing) endif () add_subdirectory (consistent-hashing-sumbur) -add_subdirectory (libwidechar_width) +add_subdirectory (widechar_width) diff --git a/base/common/CMakeLists.txt b/base/common/CMakeLists.txt new file mode 100644 index 00000000000..7990ef74a57 --- /dev/null +++ b/base/common/CMakeLists.txt @@ -0,0 +1,85 @@ +set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/config_common.h) +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config_common.h.in ${CONFIG_COMMON}) + +add_library(apple_rt apple_rt.cpp) +target_include_directories (apple_rt PUBLIC ${COMMON_INCLUDE_DIR}) +if (DEFINED APPLE_HAVE_CLOCK_GETTIME) + target_compile_definitions(apple_rt PUBLIC -DAPPLE_HAVE_CLOCK_GETTIME=${APPLE_HAVE_CLOCK_GETTIME}) +endif () + +set (COMMON_SRCS + argsToConfig.cpp + coverage.cpp + DateLUT.cpp + DateLUTImpl.cpp + demangle.cpp + getMemoryAmount.cpp + getThreadId.cpp + JSON.cpp + LineReader.cpp + mremap.cpp + phdr_cache.cpp + preciseExp10.c + setTerminalEcho.cpp + shift10.cpp + sleep.cpp +) + +if (ENABLE_REPLXX) + set (COMMON_SRCS + ReplxxLineReader.cpp + ReplxxLineReader.h + + ${COMMON_SRCS} + ) +endif () + +add_library (common + ${COMMON_SRCS} + ${CONFIG_COMMON}) + +if (USE_INTERNAL_MEMCPY) + set (MEMCPY_LIBRARIES memcpy) +endif () + +find_package (Threads) + +if(CCTZ_INCLUDE_DIR) + target_include_directories(common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR}) +endif() + +target_include_directories (common PUBLIC ${COMMON_INCLUDE_DIR}) + +if (NOT USE_INTERNAL_BOOST_LIBRARY) + target_include_directories (common SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) +endif () + +if(NOT USE_INTERNAL_POCO_LIBRARY) + target_include_directories (common SYSTEM BEFORE PUBLIC ${Poco_Foundation_INCLUDE_DIR}) +endif() + +if(CCTZ_LIBRARY) + target_link_libraries(common PRIVATE ${CCTZ_LIBRARY}) +endif() + +if (ENABLE_REPLXX) + target_link_libraries(common PUBLIC replxx) +endif () + +target_link_libraries (common + PUBLIC + ${Poco_Util_LIBRARY} + ${Poco_Foundation_LIBRARY} + ${CITYHASH_LIBRARIES} + PUBLIC + ${Boost_SYSTEM_LIBRARY} + PRIVATE + ${MEMCPY_LIBRARIES}) + +if (RT_LIBRARY) + target_link_libraries (common PRIVATE ${RT_LIBRARY}) +endif () + +if (ENABLE_TESTS) + add_subdirectory (tests) +endif () diff --git a/libs/libcommon/src/DateLUT.cpp b/base/common/DateLUT.cpp similarity index 100% rename from libs/libcommon/src/DateLUT.cpp rename to base/common/DateLUT.cpp diff --git a/libs/libcommon/include/common/DateLUT.h b/base/common/DateLUT.h similarity index 100% rename from libs/libcommon/include/common/DateLUT.h rename to base/common/DateLUT.h diff --git a/libs/libcommon/src/DateLUTImpl.cpp b/base/common/DateLUTImpl.cpp similarity index 100% rename from libs/libcommon/src/DateLUTImpl.cpp rename to base/common/DateLUTImpl.cpp diff --git a/libs/libcommon/include/common/DateLUTImpl.h b/base/common/DateLUTImpl.h similarity index 100% rename from libs/libcommon/include/common/DateLUTImpl.h rename to base/common/DateLUTImpl.h diff --git a/libs/libcommon/include/common/DayNum.h b/base/common/DayNum.h similarity index 100% rename from libs/libcommon/include/common/DayNum.h rename to base/common/DayNum.h diff --git a/libs/libcommon/include/common/ErrorHandlers.h b/base/common/ErrorHandlers.h similarity index 100% rename from libs/libcommon/include/common/ErrorHandlers.h rename to base/common/ErrorHandlers.h diff --git a/libs/libcommon/src/JSON.cpp b/base/common/JSON.cpp similarity index 100% rename from libs/libcommon/src/JSON.cpp rename to base/common/JSON.cpp diff --git a/libs/libcommon/include/common/JSON.h b/base/common/JSON.h similarity index 100% rename from libs/libcommon/include/common/JSON.h rename to base/common/JSON.h diff --git a/libs/libcommon/src/LineReader.cpp b/base/common/LineReader.cpp similarity index 100% rename from libs/libcommon/src/LineReader.cpp rename to base/common/LineReader.cpp diff --git a/libs/libcommon/include/common/LineReader.h b/base/common/LineReader.h similarity index 100% rename from libs/libcommon/include/common/LineReader.h rename to base/common/LineReader.h diff --git a/libs/libcommon/include/common/LocalDate.h b/base/common/LocalDate.h similarity index 100% rename from libs/libcommon/include/common/LocalDate.h rename to base/common/LocalDate.h diff --git a/libs/libcommon/include/common/LocalDateTime.h b/base/common/LocalDateTime.h similarity index 100% rename from libs/libcommon/include/common/LocalDateTime.h rename to base/common/LocalDateTime.h diff --git a/libs/libcommon/src/ReplxxLineReader.cpp b/base/common/ReplxxLineReader.cpp similarity index 100% rename from libs/libcommon/src/ReplxxLineReader.cpp rename to base/common/ReplxxLineReader.cpp diff --git a/libs/libcommon/include/common/ReplxxLineReader.h b/base/common/ReplxxLineReader.h similarity index 100% rename from libs/libcommon/include/common/ReplxxLineReader.h rename to base/common/ReplxxLineReader.h diff --git a/libs/libcommon/include/common/SimpleCache.h b/base/common/SimpleCache.h similarity index 100% rename from libs/libcommon/include/common/SimpleCache.h rename to base/common/SimpleCache.h diff --git a/libs/libcommon/include/common/StringRef.h b/base/common/StringRef.h similarity index 100% rename from libs/libcommon/include/common/StringRef.h rename to base/common/StringRef.h diff --git a/libs/libcommon/include/common/Types.h b/base/common/Types.h similarity index 100% rename from libs/libcommon/include/common/Types.h rename to base/common/Types.h diff --git a/libs/libcommon/src/apple_rt.cpp b/base/common/apple_rt.cpp similarity index 100% rename from libs/libcommon/src/apple_rt.cpp rename to base/common/apple_rt.cpp diff --git a/libs/libcommon/src/argsToConfig.cpp b/base/common/argsToConfig.cpp similarity index 100% rename from libs/libcommon/src/argsToConfig.cpp rename to base/common/argsToConfig.cpp diff --git a/libs/libcommon/include/common/argsToConfig.h b/base/common/argsToConfig.h similarity index 100% rename from libs/libcommon/include/common/argsToConfig.h rename to base/common/argsToConfig.h diff --git a/libs/libcommon/include/common/arithmeticOverflow.h b/base/common/arithmeticOverflow.h similarity index 100% rename from libs/libcommon/include/common/arithmeticOverflow.h rename to base/common/arithmeticOverflow.h diff --git a/libs/libcommon/include/common/config_common.h.in b/base/common/config_common.h.in similarity index 100% rename from libs/libcommon/include/common/config_common.h.in rename to base/common/config_common.h.in diff --git a/libs/libcommon/include/common/constexpr_helpers.h b/base/common/constexpr_helpers.h similarity index 100% rename from libs/libcommon/include/common/constexpr_helpers.h rename to base/common/constexpr_helpers.h diff --git a/libs/libcommon/src/coverage.cpp b/base/common/coverage.cpp similarity index 100% rename from libs/libcommon/src/coverage.cpp rename to base/common/coverage.cpp diff --git a/libs/libcommon/include/common/coverage.h b/base/common/coverage.h similarity index 100% rename from libs/libcommon/include/common/coverage.h rename to base/common/coverage.h diff --git a/libs/libcommon/src/demangle.cpp b/base/common/demangle.cpp similarity index 100% rename from libs/libcommon/src/demangle.cpp rename to base/common/demangle.cpp diff --git a/libs/libcommon/include/common/demangle.h b/base/common/demangle.h similarity index 100% rename from libs/libcommon/include/common/demangle.h rename to base/common/demangle.h diff --git a/libs/libcommon/include/common/find_symbols.h b/base/common/find_symbols.h similarity index 100% rename from libs/libcommon/include/common/find_symbols.h rename to base/common/find_symbols.h diff --git a/libs/libcommon/src/getMemoryAmount.cpp b/base/common/getMemoryAmount.cpp similarity index 100% rename from libs/libcommon/src/getMemoryAmount.cpp rename to base/common/getMemoryAmount.cpp diff --git a/libs/libcommon/include/common/getMemoryAmount.h b/base/common/getMemoryAmount.h similarity index 100% rename from libs/libcommon/include/common/getMemoryAmount.h rename to base/common/getMemoryAmount.h diff --git a/libs/libcommon/src/getThreadId.cpp b/base/common/getThreadId.cpp similarity index 100% rename from libs/libcommon/src/getThreadId.cpp rename to base/common/getThreadId.cpp diff --git a/libs/libcommon/include/common/getThreadId.h b/base/common/getThreadId.h similarity index 100% rename from libs/libcommon/include/common/getThreadId.h rename to base/common/getThreadId.h diff --git a/libs/libcommon/include/common/iostream_debug_helpers.h b/base/common/iostream_debug_helpers.h similarity index 100% rename from libs/libcommon/include/common/iostream_debug_helpers.h rename to base/common/iostream_debug_helpers.h diff --git a/libs/libcommon/include/common/itoa.h b/base/common/itoa.h similarity index 100% rename from libs/libcommon/include/common/itoa.h rename to base/common/itoa.h diff --git a/libs/libcommon/include/common/likely.h b/base/common/likely.h similarity index 100% rename from libs/libcommon/include/common/likely.h rename to base/common/likely.h diff --git a/libs/libcommon/include/common/logger_useful.h b/base/common/logger_useful.h similarity index 100% rename from libs/libcommon/include/common/logger_useful.h rename to base/common/logger_useful.h diff --git a/libs/libcommon/include/common/memory.h b/base/common/memory.h similarity index 100% rename from libs/libcommon/include/common/memory.h rename to base/common/memory.h diff --git a/libs/libcommon/src/mremap.cpp b/base/common/mremap.cpp similarity index 100% rename from libs/libcommon/src/mremap.cpp rename to base/common/mremap.cpp diff --git a/libs/libcommon/include/common/mremap.h b/base/common/mremap.h similarity index 100% rename from libs/libcommon/include/common/mremap.h rename to base/common/mremap.h diff --git a/libs/libcommon/src/phdr_cache.cpp b/base/common/phdr_cache.cpp similarity index 100% rename from libs/libcommon/src/phdr_cache.cpp rename to base/common/phdr_cache.cpp diff --git a/libs/libcommon/include/common/phdr_cache.h b/base/common/phdr_cache.h similarity index 100% rename from libs/libcommon/include/common/phdr_cache.h rename to base/common/phdr_cache.h diff --git a/libs/libcommon/src/preciseExp10.c b/base/common/preciseExp10.c similarity index 100% rename from libs/libcommon/src/preciseExp10.c rename to base/common/preciseExp10.c diff --git a/libs/libcommon/include/common/preciseExp10.h b/base/common/preciseExp10.h similarity index 100% rename from libs/libcommon/include/common/preciseExp10.h rename to base/common/preciseExp10.h diff --git a/libs/libcommon/src/setTerminalEcho.cpp b/base/common/setTerminalEcho.cpp similarity index 100% rename from libs/libcommon/src/setTerminalEcho.cpp rename to base/common/setTerminalEcho.cpp diff --git a/libs/libcommon/include/common/setTerminalEcho.h b/base/common/setTerminalEcho.h similarity index 100% rename from libs/libcommon/include/common/setTerminalEcho.h rename to base/common/setTerminalEcho.h diff --git a/libs/libcommon/src/shift10.cpp b/base/common/shift10.cpp similarity index 100% rename from libs/libcommon/src/shift10.cpp rename to base/common/shift10.cpp diff --git a/libs/libcommon/include/common/shift10.h b/base/common/shift10.h similarity index 100% rename from libs/libcommon/include/common/shift10.h rename to base/common/shift10.h diff --git a/libs/libcommon/src/sleep.cpp b/base/common/sleep.cpp similarity index 100% rename from libs/libcommon/src/sleep.cpp rename to base/common/sleep.cpp diff --git a/libs/libcommon/include/common/sleep.h b/base/common/sleep.h similarity index 100% rename from libs/libcommon/include/common/sleep.h rename to base/common/sleep.h diff --git a/libs/libcommon/include/common/strong_typedef.h b/base/common/strong_typedef.h similarity index 100% rename from libs/libcommon/include/common/strong_typedef.h rename to base/common/strong_typedef.h diff --git a/libs/libcommon/src/tests/CMakeLists.txt b/base/common/tests/CMakeLists.txt similarity index 100% rename from libs/libcommon/src/tests/CMakeLists.txt rename to base/common/tests/CMakeLists.txt diff --git a/libs/libcommon/src/tests/allocator.cpp b/base/common/tests/allocator.cpp similarity index 100% rename from libs/libcommon/src/tests/allocator.cpp rename to base/common/tests/allocator.cpp diff --git a/libs/libcommon/src/tests/date_lut2.cpp b/base/common/tests/date_lut2.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut2.cpp rename to base/common/tests/date_lut2.cpp diff --git a/libs/libcommon/src/tests/date_lut3.cpp b/base/common/tests/date_lut3.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut3.cpp rename to base/common/tests/date_lut3.cpp diff --git a/libs/libcommon/src/tests/date_lut4.cpp b/base/common/tests/date_lut4.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut4.cpp rename to base/common/tests/date_lut4.cpp diff --git a/libs/libcommon/src/tests/date_lut_default_timezone.cpp b/base/common/tests/date_lut_default_timezone.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut_default_timezone.cpp rename to base/common/tests/date_lut_default_timezone.cpp diff --git a/libs/libcommon/src/tests/date_lut_init.cpp b/base/common/tests/date_lut_init.cpp similarity index 100% rename from libs/libcommon/src/tests/date_lut_init.cpp rename to base/common/tests/date_lut_init.cpp diff --git a/libs/libcommon/src/tests/dump_variable.cpp b/base/common/tests/dump_variable.cpp similarity index 100% rename from libs/libcommon/src/tests/dump_variable.cpp rename to base/common/tests/dump_variable.cpp diff --git a/libs/libcommon/src/tests/gtest_find_symbols.cpp b/base/common/tests/gtest_find_symbols.cpp similarity index 100% rename from libs/libcommon/src/tests/gtest_find_symbols.cpp rename to base/common/tests/gtest_find_symbols.cpp diff --git a/libs/libcommon/src/tests/gtest_json_test.cpp b/base/common/tests/gtest_json_test.cpp similarity index 100% rename from libs/libcommon/src/tests/gtest_json_test.cpp rename to base/common/tests/gtest_json_test.cpp diff --git a/libs/libcommon/src/tests/gtest_strong_typedef.cpp b/base/common/tests/gtest_strong_typedef.cpp similarity index 100% rename from libs/libcommon/src/tests/gtest_strong_typedef.cpp rename to base/common/tests/gtest_strong_typedef.cpp diff --git a/libs/libcommon/src/tests/local_date_time_comparison.cpp b/base/common/tests/local_date_time_comparison.cpp similarity index 100% rename from libs/libcommon/src/tests/local_date_time_comparison.cpp rename to base/common/tests/local_date_time_comparison.cpp diff --git a/libs/libcommon/include/common/unaligned.h b/base/common/unaligned.h similarity index 100% rename from libs/libcommon/include/common/unaligned.h rename to base/common/unaligned.h diff --git a/libs/consistent-hashing-sumbur/CMakeLists.txt b/base/consistent-hashing-sumbur/CMakeLists.txt similarity index 100% rename from libs/consistent-hashing-sumbur/CMakeLists.txt rename to base/consistent-hashing-sumbur/CMakeLists.txt diff --git a/libs/consistent-hashing-sumbur/sumbur.cpp b/base/consistent-hashing-sumbur/sumbur.cpp similarity index 100% rename from libs/consistent-hashing-sumbur/sumbur.cpp rename to base/consistent-hashing-sumbur/sumbur.cpp diff --git a/libs/consistent-hashing-sumbur/sumbur.h b/base/consistent-hashing-sumbur/sumbur.h similarity index 100% rename from libs/consistent-hashing-sumbur/sumbur.h rename to base/consistent-hashing-sumbur/sumbur.h diff --git a/libs/consistent-hashing/CMakeLists.txt b/base/consistent-hashing/CMakeLists.txt similarity index 100% rename from libs/consistent-hashing/CMakeLists.txt rename to base/consistent-hashing/CMakeLists.txt diff --git a/libs/consistent-hashing/bitops.h b/base/consistent-hashing/bitops.h similarity index 100% rename from libs/consistent-hashing/bitops.h rename to base/consistent-hashing/bitops.h diff --git a/libs/consistent-hashing/consistent_hashing.cpp b/base/consistent-hashing/consistent_hashing.cpp similarity index 100% rename from libs/consistent-hashing/consistent_hashing.cpp rename to base/consistent-hashing/consistent_hashing.cpp diff --git a/libs/consistent-hashing/consistent_hashing.h b/base/consistent-hashing/consistent_hashing.h similarity index 100% rename from libs/consistent-hashing/consistent_hashing.h rename to base/consistent-hashing/consistent_hashing.h diff --git a/libs/consistent-hashing/popcount.cpp b/base/consistent-hashing/popcount.cpp similarity index 100% rename from libs/consistent-hashing/popcount.cpp rename to base/consistent-hashing/popcount.cpp diff --git a/libs/consistent-hashing/popcount.h b/base/consistent-hashing/popcount.h similarity index 100% rename from libs/consistent-hashing/popcount.h rename to base/consistent-hashing/popcount.h diff --git a/libs/libdaemon/CMakeLists.txt b/base/daemon/CMakeLists.txt similarity index 100% rename from libs/libdaemon/CMakeLists.txt rename to base/daemon/CMakeLists.txt diff --git a/libs/libdaemon/include/daemon/BaseDaemon.h b/base/daemon/include/daemon/BaseDaemon.h similarity index 100% rename from libs/libdaemon/include/daemon/BaseDaemon.h rename to base/daemon/include/daemon/BaseDaemon.h diff --git a/libs/libdaemon/include/daemon/GraphiteWriter.h b/base/daemon/include/daemon/GraphiteWriter.h similarity index 100% rename from libs/libdaemon/include/daemon/GraphiteWriter.h rename to base/daemon/include/daemon/GraphiteWriter.h diff --git a/libs/libdaemon/src/BaseDaemon.cpp b/base/daemon/src/BaseDaemon.cpp similarity index 100% rename from libs/libdaemon/src/BaseDaemon.cpp rename to base/daemon/src/BaseDaemon.cpp diff --git a/libs/libdaemon/src/GraphiteWriter.cpp b/base/daemon/src/GraphiteWriter.cpp similarity index 100% rename from libs/libdaemon/src/GraphiteWriter.cpp rename to base/daemon/src/GraphiteWriter.cpp diff --git a/libs/libcommon/include/ext/bit_cast.h b/base/ext/bit_cast.h similarity index 100% rename from libs/libcommon/include/ext/bit_cast.h rename to base/ext/bit_cast.h diff --git a/libs/libcommon/include/ext/chrono_io.h b/base/ext/chrono_io.h similarity index 100% rename from libs/libcommon/include/ext/chrono_io.h rename to base/ext/chrono_io.h diff --git a/libs/libcommon/include/ext/collection_cast.h b/base/ext/collection_cast.h similarity index 100% rename from libs/libcommon/include/ext/collection_cast.h rename to base/ext/collection_cast.h diff --git a/libs/libcommon/include/ext/enumerate.h b/base/ext/enumerate.h similarity index 100% rename from libs/libcommon/include/ext/enumerate.h rename to base/ext/enumerate.h diff --git a/libs/libcommon/include/ext/function_traits.h b/base/ext/function_traits.h similarity index 100% rename from libs/libcommon/include/ext/function_traits.h rename to base/ext/function_traits.h diff --git a/libs/libcommon/include/ext/identity.h b/base/ext/identity.h similarity index 100% rename from libs/libcommon/include/ext/identity.h rename to base/ext/identity.h diff --git a/libs/libcommon/include/ext/make_array_n.h b/base/ext/make_array_n.h similarity index 100% rename from libs/libcommon/include/ext/make_array_n.h rename to base/ext/make_array_n.h diff --git a/libs/libcommon/include/ext/map.h b/base/ext/map.h similarity index 100% rename from libs/libcommon/include/ext/map.h rename to base/ext/map.h diff --git a/libs/libcommon/include/ext/push_back.h b/base/ext/push_back.h similarity index 100% rename from libs/libcommon/include/ext/push_back.h rename to base/ext/push_back.h diff --git a/libs/libcommon/include/ext/range.h b/base/ext/range.h similarity index 100% rename from libs/libcommon/include/ext/range.h rename to base/ext/range.h diff --git a/libs/libcommon/include/ext/scope_guard.h b/base/ext/scope_guard.h similarity index 100% rename from libs/libcommon/include/ext/scope_guard.h rename to base/ext/scope_guard.h diff --git a/libs/libcommon/include/ext/shared_ptr_helper.h b/base/ext/shared_ptr_helper.h similarity index 100% rename from libs/libcommon/include/ext/shared_ptr_helper.h rename to base/ext/shared_ptr_helper.h diff --git a/libs/libcommon/include/ext/singleton.h b/base/ext/singleton.h similarity index 100% rename from libs/libcommon/include/ext/singleton.h rename to base/ext/singleton.h diff --git a/libs/libcommon/include/ext/size.h b/base/ext/size.h similarity index 100% rename from libs/libcommon/include/ext/size.h rename to base/ext/size.h diff --git a/libs/libcommon/include/ext/unlock_guard.h b/base/ext/unlock_guard.h similarity index 100% rename from libs/libcommon/include/ext/unlock_guard.h rename to base/ext/unlock_guard.h diff --git a/libs/libglibc-compatibility/CMakeLists.txt b/base/glibc-compatibility/CMakeLists.txt similarity index 100% rename from libs/libglibc-compatibility/CMakeLists.txt rename to base/glibc-compatibility/CMakeLists.txt diff --git a/libs/libglibc-compatibility/glibc-compatibility.c b/base/glibc-compatibility/glibc-compatibility.c similarity index 100% rename from libs/libglibc-compatibility/glibc-compatibility.c rename to base/glibc-compatibility/glibc-compatibility.c diff --git a/libs/libglibc-compatibility/musl/COPYRIGHT b/base/glibc-compatibility/musl/COPYRIGHT similarity index 100% rename from libs/libglibc-compatibility/musl/COPYRIGHT rename to base/glibc-compatibility/musl/COPYRIGHT diff --git a/libs/libglibc-compatibility/musl/README b/base/glibc-compatibility/musl/README similarity index 100% rename from libs/libglibc-compatibility/musl/README rename to base/glibc-compatibility/musl/README diff --git a/libs/libglibc-compatibility/musl/__math_divzero.c b/base/glibc-compatibility/musl/__math_divzero.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_divzero.c rename to base/glibc-compatibility/musl/__math_divzero.c diff --git a/libs/libglibc-compatibility/musl/__math_divzerof.c b/base/glibc-compatibility/musl/__math_divzerof.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_divzerof.c rename to base/glibc-compatibility/musl/__math_divzerof.c diff --git a/libs/libglibc-compatibility/musl/__math_invalid.c b/base/glibc-compatibility/musl/__math_invalid.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_invalid.c rename to base/glibc-compatibility/musl/__math_invalid.c diff --git a/libs/libglibc-compatibility/musl/__math_invalidf.c b/base/glibc-compatibility/musl/__math_invalidf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_invalidf.c rename to base/glibc-compatibility/musl/__math_invalidf.c diff --git a/libs/libglibc-compatibility/musl/__math_oflow.c b/base/glibc-compatibility/musl/__math_oflow.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_oflow.c rename to base/glibc-compatibility/musl/__math_oflow.c diff --git a/libs/libglibc-compatibility/musl/__math_oflowf.c b/base/glibc-compatibility/musl/__math_oflowf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_oflowf.c rename to base/glibc-compatibility/musl/__math_oflowf.c diff --git a/libs/libglibc-compatibility/musl/__math_uflow.c b/base/glibc-compatibility/musl/__math_uflow.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_uflow.c rename to base/glibc-compatibility/musl/__math_uflow.c diff --git a/libs/libglibc-compatibility/musl/__math_uflowf.c b/base/glibc-compatibility/musl/__math_uflowf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_uflowf.c rename to base/glibc-compatibility/musl/__math_uflowf.c diff --git a/libs/libglibc-compatibility/musl/__math_xflow.c b/base/glibc-compatibility/musl/__math_xflow.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_xflow.c rename to base/glibc-compatibility/musl/__math_xflow.c diff --git a/libs/libglibc-compatibility/musl/__math_xflowf.c b/base/glibc-compatibility/musl/__math_xflowf.c similarity index 100% rename from libs/libglibc-compatibility/musl/__math_xflowf.c rename to base/glibc-compatibility/musl/__math_xflowf.c diff --git a/libs/libglibc-compatibility/musl/aarch64/atomic_arch.h b/base/glibc-compatibility/musl/aarch64/atomic_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/atomic_arch.h rename to base/glibc-compatibility/musl/aarch64/atomic_arch.h diff --git a/libs/libglibc-compatibility/musl/aarch64/longjmp.s b/base/glibc-compatibility/musl/aarch64/longjmp.s similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/longjmp.s rename to base/glibc-compatibility/musl/aarch64/longjmp.s diff --git a/libs/libglibc-compatibility/musl/aarch64/syscall.s b/base/glibc-compatibility/musl/aarch64/syscall.s similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/syscall.s rename to base/glibc-compatibility/musl/aarch64/syscall.s diff --git a/libs/libglibc-compatibility/musl/aarch64/syscall_arch.h b/base/glibc-compatibility/musl/aarch64/syscall_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/aarch64/syscall_arch.h rename to base/glibc-compatibility/musl/aarch64/syscall_arch.h diff --git a/libs/libglibc-compatibility/musl/atomic.h b/base/glibc-compatibility/musl/atomic.h similarity index 100% rename from libs/libglibc-compatibility/musl/atomic.h rename to base/glibc-compatibility/musl/atomic.h diff --git a/libs/libglibc-compatibility/musl/clock_gettime.c b/base/glibc-compatibility/musl/clock_gettime.c similarity index 100% rename from libs/libglibc-compatibility/musl/clock_gettime.c rename to base/glibc-compatibility/musl/clock_gettime.c diff --git a/libs/libglibc-compatibility/musl/clock_nanosleep.c b/base/glibc-compatibility/musl/clock_nanosleep.c similarity index 100% rename from libs/libglibc-compatibility/musl/clock_nanosleep.c rename to base/glibc-compatibility/musl/clock_nanosleep.c diff --git a/libs/libglibc-compatibility/musl/exp.c b/base/glibc-compatibility/musl/exp.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp.c rename to base/glibc-compatibility/musl/exp.c diff --git a/libs/libglibc-compatibility/musl/exp2.c b/base/glibc-compatibility/musl/exp2.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp2.c rename to base/glibc-compatibility/musl/exp2.c diff --git a/libs/libglibc-compatibility/musl/exp2f.c b/base/glibc-compatibility/musl/exp2f.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp2f.c rename to base/glibc-compatibility/musl/exp2f.c diff --git a/libs/libglibc-compatibility/musl/exp2f_data.c b/base/glibc-compatibility/musl/exp2f_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp2f_data.c rename to base/glibc-compatibility/musl/exp2f_data.c diff --git a/libs/libglibc-compatibility/musl/exp2f_data.h b/base/glibc-compatibility/musl/exp2f_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/exp2f_data.h rename to base/glibc-compatibility/musl/exp2f_data.h diff --git a/libs/libglibc-compatibility/musl/exp_data.c b/base/glibc-compatibility/musl/exp_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/exp_data.c rename to base/glibc-compatibility/musl/exp_data.c diff --git a/libs/libglibc-compatibility/musl/exp_data.h b/base/glibc-compatibility/musl/exp_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/exp_data.h rename to base/glibc-compatibility/musl/exp_data.h diff --git a/libs/libglibc-compatibility/musl/fallocate.c b/base/glibc-compatibility/musl/fallocate.c similarity index 100% rename from libs/libglibc-compatibility/musl/fallocate.c rename to base/glibc-compatibility/musl/fallocate.c diff --git a/libs/libglibc-compatibility/musl/fcntl.c b/base/glibc-compatibility/musl/fcntl.c similarity index 100% rename from libs/libglibc-compatibility/musl/fcntl.c rename to base/glibc-compatibility/musl/fcntl.c diff --git a/libs/libglibc-compatibility/musl/futimens.c b/base/glibc-compatibility/musl/futimens.c similarity index 100% rename from libs/libglibc-compatibility/musl/futimens.c rename to base/glibc-compatibility/musl/futimens.c diff --git a/libs/libglibc-compatibility/musl/getentropy.c b/base/glibc-compatibility/musl/getentropy.c similarity index 100% rename from libs/libglibc-compatibility/musl/getentropy.c rename to base/glibc-compatibility/musl/getentropy.c diff --git a/libs/libglibc-compatibility/musl/getrandom.c b/base/glibc-compatibility/musl/getrandom.c similarity index 100% rename from libs/libglibc-compatibility/musl/getrandom.c rename to base/glibc-compatibility/musl/getrandom.c diff --git a/libs/libglibc-compatibility/musl/glob.c b/base/glibc-compatibility/musl/glob.c similarity index 100% rename from libs/libglibc-compatibility/musl/glob.c rename to base/glibc-compatibility/musl/glob.c diff --git a/libs/libglibc-compatibility/musl/lgamma.c b/base/glibc-compatibility/musl/lgamma.c similarity index 100% rename from libs/libglibc-compatibility/musl/lgamma.c rename to base/glibc-compatibility/musl/lgamma.c diff --git a/libs/libglibc-compatibility/musl/libm.h b/base/glibc-compatibility/musl/libm.h similarity index 100% rename from libs/libglibc-compatibility/musl/libm.h rename to base/glibc-compatibility/musl/libm.h diff --git a/libs/libglibc-compatibility/musl/log.c b/base/glibc-compatibility/musl/log.c similarity index 100% rename from libs/libglibc-compatibility/musl/log.c rename to base/glibc-compatibility/musl/log.c diff --git a/libs/libglibc-compatibility/musl/log2.c b/base/glibc-compatibility/musl/log2.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2.c rename to base/glibc-compatibility/musl/log2.c diff --git a/libs/libglibc-compatibility/musl/log2_data.c b/base/glibc-compatibility/musl/log2_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2_data.c rename to base/glibc-compatibility/musl/log2_data.c diff --git a/libs/libglibc-compatibility/musl/log2_data.h b/base/glibc-compatibility/musl/log2_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/log2_data.h rename to base/glibc-compatibility/musl/log2_data.h diff --git a/libs/libglibc-compatibility/musl/log2f.c b/base/glibc-compatibility/musl/log2f.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2f.c rename to base/glibc-compatibility/musl/log2f.c diff --git a/libs/libglibc-compatibility/musl/log2f_data.c b/base/glibc-compatibility/musl/log2f_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/log2f_data.c rename to base/glibc-compatibility/musl/log2f_data.c diff --git a/libs/libglibc-compatibility/musl/log2f_data.h b/base/glibc-compatibility/musl/log2f_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/log2f_data.h rename to base/glibc-compatibility/musl/log2f_data.h diff --git a/libs/libglibc-compatibility/musl/log_data.c b/base/glibc-compatibility/musl/log_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/log_data.c rename to base/glibc-compatibility/musl/log_data.c diff --git a/libs/libglibc-compatibility/musl/log_data.h b/base/glibc-compatibility/musl/log_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/log_data.h rename to base/glibc-compatibility/musl/log_data.h diff --git a/libs/libglibc-compatibility/musl/logf.c b/base/glibc-compatibility/musl/logf.c similarity index 100% rename from libs/libglibc-compatibility/musl/logf.c rename to base/glibc-compatibility/musl/logf.c diff --git a/libs/libglibc-compatibility/musl/logf_data.c b/base/glibc-compatibility/musl/logf_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/logf_data.c rename to base/glibc-compatibility/musl/logf_data.c diff --git a/libs/libglibc-compatibility/musl/logf_data.h b/base/glibc-compatibility/musl/logf_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/logf_data.h rename to base/glibc-compatibility/musl/logf_data.h diff --git a/libs/libglibc-compatibility/musl/musl_features.h b/base/glibc-compatibility/musl/musl_features.h similarity index 100% rename from libs/libglibc-compatibility/musl/musl_features.h rename to base/glibc-compatibility/musl/musl_features.h diff --git a/libs/libglibc-compatibility/musl/pipe2.c b/base/glibc-compatibility/musl/pipe2.c similarity index 100% rename from libs/libglibc-compatibility/musl/pipe2.c rename to base/glibc-compatibility/musl/pipe2.c diff --git a/libs/libglibc-compatibility/musl/posix_spawn.c b/base/glibc-compatibility/musl/posix_spawn.c similarity index 100% rename from libs/libglibc-compatibility/musl/posix_spawn.c rename to base/glibc-compatibility/musl/posix_spawn.c diff --git a/libs/libglibc-compatibility/musl/pow.c b/base/glibc-compatibility/musl/pow.c similarity index 100% rename from libs/libglibc-compatibility/musl/pow.c rename to base/glibc-compatibility/musl/pow.c diff --git a/libs/libglibc-compatibility/musl/pow_data.c b/base/glibc-compatibility/musl/pow_data.c similarity index 100% rename from libs/libglibc-compatibility/musl/pow_data.c rename to base/glibc-compatibility/musl/pow_data.c diff --git a/libs/libglibc-compatibility/musl/pow_data.h b/base/glibc-compatibility/musl/pow_data.h similarity index 100% rename from libs/libglibc-compatibility/musl/pow_data.h rename to base/glibc-compatibility/musl/pow_data.h diff --git a/libs/libglibc-compatibility/musl/pwritev.c b/base/glibc-compatibility/musl/pwritev.c similarity index 100% rename from libs/libglibc-compatibility/musl/pwritev.c rename to base/glibc-compatibility/musl/pwritev.c diff --git a/libs/libglibc-compatibility/musl/sched_cpucount.c b/base/glibc-compatibility/musl/sched_cpucount.c similarity index 100% rename from libs/libglibc-compatibility/musl/sched_cpucount.c rename to base/glibc-compatibility/musl/sched_cpucount.c diff --git a/libs/libglibc-compatibility/musl/sched_getcpu.c b/base/glibc-compatibility/musl/sched_getcpu.c similarity index 100% rename from libs/libglibc-compatibility/musl/sched_getcpu.c rename to base/glibc-compatibility/musl/sched_getcpu.c diff --git a/libs/libglibc-compatibility/musl/syscall.h b/base/glibc-compatibility/musl/syscall.h similarity index 100% rename from libs/libglibc-compatibility/musl/syscall.h rename to base/glibc-compatibility/musl/syscall.h diff --git a/libs/libglibc-compatibility/musl/syscall_ret.c b/base/glibc-compatibility/musl/syscall_ret.c similarity index 100% rename from libs/libglibc-compatibility/musl/syscall_ret.c rename to base/glibc-compatibility/musl/syscall_ret.c diff --git a/libs/libglibc-compatibility/musl/timespec_get.c b/base/glibc-compatibility/musl/timespec_get.c similarity index 100% rename from libs/libglibc-compatibility/musl/timespec_get.c rename to base/glibc-compatibility/musl/timespec_get.c diff --git a/libs/libglibc-compatibility/musl/utimensat.c b/base/glibc-compatibility/musl/utimensat.c similarity index 100% rename from libs/libglibc-compatibility/musl/utimensat.c rename to base/glibc-compatibility/musl/utimensat.c diff --git a/libs/libglibc-compatibility/musl/vasprintf.c b/base/glibc-compatibility/musl/vasprintf.c similarity index 100% rename from libs/libglibc-compatibility/musl/vasprintf.c rename to base/glibc-compatibility/musl/vasprintf.c diff --git a/libs/libglibc-compatibility/musl/vdso.c b/base/glibc-compatibility/musl/vdso.c similarity index 100% rename from libs/libglibc-compatibility/musl/vdso.c rename to base/glibc-compatibility/musl/vdso.c diff --git a/libs/libglibc-compatibility/musl/x86_64/atomic_arch.h b/base/glibc-compatibility/musl/x86_64/atomic_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/atomic_arch.h rename to base/glibc-compatibility/musl/x86_64/atomic_arch.h diff --git a/libs/libglibc-compatibility/musl/x86_64/longjmp.s b/base/glibc-compatibility/musl/x86_64/longjmp.s similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/longjmp.s rename to base/glibc-compatibility/musl/x86_64/longjmp.s diff --git a/libs/libglibc-compatibility/musl/x86_64/syscall.s b/base/glibc-compatibility/musl/x86_64/syscall.s similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/syscall.s rename to base/glibc-compatibility/musl/x86_64/syscall.s diff --git a/libs/libglibc-compatibility/musl/x86_64/syscall_arch.h b/base/glibc-compatibility/musl/x86_64/syscall_arch.h similarity index 100% rename from libs/libglibc-compatibility/musl/x86_64/syscall_arch.h rename to base/glibc-compatibility/musl/x86_64/syscall_arch.h diff --git a/libs/libloggers/CMakeLists.txt b/base/loggers/CMakeLists.txt similarity index 100% rename from libs/libloggers/CMakeLists.txt rename to base/loggers/CMakeLists.txt diff --git a/libs/libloggers/loggers/CMakeLists.txt b/base/loggers/loggers/CMakeLists.txt similarity index 100% rename from libs/libloggers/loggers/CMakeLists.txt rename to base/loggers/loggers/CMakeLists.txt diff --git a/libs/libloggers/loggers/ExtendedLogChannel.cpp b/base/loggers/loggers/ExtendedLogChannel.cpp similarity index 100% rename from libs/libloggers/loggers/ExtendedLogChannel.cpp rename to base/loggers/loggers/ExtendedLogChannel.cpp diff --git a/libs/libloggers/loggers/ExtendedLogChannel.h b/base/loggers/loggers/ExtendedLogChannel.h similarity index 100% rename from libs/libloggers/loggers/ExtendedLogChannel.h rename to base/loggers/loggers/ExtendedLogChannel.h diff --git a/libs/libloggers/loggers/Loggers.cpp b/base/loggers/loggers/Loggers.cpp similarity index 100% rename from libs/libloggers/loggers/Loggers.cpp rename to base/loggers/loggers/Loggers.cpp diff --git a/libs/libloggers/loggers/Loggers.h b/base/loggers/loggers/Loggers.h similarity index 100% rename from libs/libloggers/loggers/Loggers.h rename to base/loggers/loggers/Loggers.h diff --git a/libs/libloggers/loggers/OwnFormattingChannel.cpp b/base/loggers/loggers/OwnFormattingChannel.cpp similarity index 100% rename from libs/libloggers/loggers/OwnFormattingChannel.cpp rename to base/loggers/loggers/OwnFormattingChannel.cpp diff --git a/libs/libloggers/loggers/OwnFormattingChannel.h b/base/loggers/loggers/OwnFormattingChannel.h similarity index 100% rename from libs/libloggers/loggers/OwnFormattingChannel.h rename to base/loggers/loggers/OwnFormattingChannel.h diff --git a/libs/libloggers/loggers/OwnPatternFormatter.cpp b/base/loggers/loggers/OwnPatternFormatter.cpp similarity index 100% rename from libs/libloggers/loggers/OwnPatternFormatter.cpp rename to base/loggers/loggers/OwnPatternFormatter.cpp diff --git a/libs/libloggers/loggers/OwnPatternFormatter.h b/base/loggers/loggers/OwnPatternFormatter.h similarity index 100% rename from libs/libloggers/loggers/OwnPatternFormatter.h rename to base/loggers/loggers/OwnPatternFormatter.h diff --git a/libs/libloggers/loggers/OwnSplitChannel.cpp b/base/loggers/loggers/OwnSplitChannel.cpp similarity index 100% rename from libs/libloggers/loggers/OwnSplitChannel.cpp rename to base/loggers/loggers/OwnSplitChannel.cpp diff --git a/libs/libloggers/loggers/OwnSplitChannel.h b/base/loggers/loggers/OwnSplitChannel.h similarity index 100% rename from libs/libloggers/loggers/OwnSplitChannel.h rename to base/loggers/loggers/OwnSplitChannel.h diff --git a/libs/libmemcpy/CMakeLists.txt b/base/memcpy/CMakeLists.txt similarity index 100% rename from libs/libmemcpy/CMakeLists.txt rename to base/memcpy/CMakeLists.txt diff --git a/libs/libmemcpy/README.md b/base/memcpy/README.md similarity index 100% rename from libs/libmemcpy/README.md rename to base/memcpy/README.md diff --git a/libs/libmemcpy/impl/FastMemcpy.h b/base/memcpy/impl/FastMemcpy.h similarity index 100% rename from libs/libmemcpy/impl/FastMemcpy.h rename to base/memcpy/impl/FastMemcpy.h diff --git a/libs/libmemcpy/impl/LICENSE b/base/memcpy/impl/LICENSE similarity index 100% rename from libs/libmemcpy/impl/LICENSE rename to base/memcpy/impl/LICENSE diff --git a/libs/libmemcpy/impl/README.md b/base/memcpy/impl/README.md similarity index 100% rename from libs/libmemcpy/impl/README.md rename to base/memcpy/impl/README.md diff --git a/libs/libmemcpy/memcpy.c b/base/memcpy/memcpy.c similarity index 100% rename from libs/libmemcpy/memcpy.c rename to base/memcpy/memcpy.c diff --git a/libs/libmemcpy/memcpy.h b/base/memcpy/memcpy.h similarity index 100% rename from libs/libmemcpy/memcpy.h rename to base/memcpy/memcpy.h diff --git a/libs/libmysqlxx/CMakeLists.txt b/base/mysqlxx/CMakeLists.txt similarity index 100% rename from libs/libmysqlxx/CMakeLists.txt rename to base/mysqlxx/CMakeLists.txt diff --git a/libs/libmysqlxx/include/mysqlxx/Connection.h b/base/mysqlxx/include/mysqlxx/Connection.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Connection.h rename to base/mysqlxx/include/mysqlxx/Connection.h diff --git a/libs/libmysqlxx/include/mysqlxx/Exception.h b/base/mysqlxx/include/mysqlxx/Exception.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Exception.h rename to base/mysqlxx/include/mysqlxx/Exception.h diff --git a/libs/libmysqlxx/include/mysqlxx/Null.h b/base/mysqlxx/include/mysqlxx/Null.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Null.h rename to base/mysqlxx/include/mysqlxx/Null.h diff --git a/libs/libmysqlxx/include/mysqlxx/Pool.h b/base/mysqlxx/include/mysqlxx/Pool.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Pool.h rename to base/mysqlxx/include/mysqlxx/Pool.h diff --git a/libs/libmysqlxx/include/mysqlxx/PoolWithFailover.h b/base/mysqlxx/include/mysqlxx/PoolWithFailover.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/PoolWithFailover.h rename to base/mysqlxx/include/mysqlxx/PoolWithFailover.h diff --git a/libs/libmysqlxx/include/mysqlxx/Query.h b/base/mysqlxx/include/mysqlxx/Query.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Query.h rename to base/mysqlxx/include/mysqlxx/Query.h diff --git a/libs/libmysqlxx/include/mysqlxx/ResultBase.h b/base/mysqlxx/include/mysqlxx/ResultBase.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/ResultBase.h rename to base/mysqlxx/include/mysqlxx/ResultBase.h diff --git a/libs/libmysqlxx/include/mysqlxx/Row.h b/base/mysqlxx/include/mysqlxx/Row.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Row.h rename to base/mysqlxx/include/mysqlxx/Row.h diff --git a/libs/libmysqlxx/include/mysqlxx/StoreQueryResult.h b/base/mysqlxx/include/mysqlxx/StoreQueryResult.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/StoreQueryResult.h rename to base/mysqlxx/include/mysqlxx/StoreQueryResult.h diff --git a/libs/libmysqlxx/include/mysqlxx/Transaction.h b/base/mysqlxx/include/mysqlxx/Transaction.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Transaction.h rename to base/mysqlxx/include/mysqlxx/Transaction.h diff --git a/libs/libmysqlxx/include/mysqlxx/Types.h b/base/mysqlxx/include/mysqlxx/Types.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Types.h rename to base/mysqlxx/include/mysqlxx/Types.h diff --git a/libs/libmysqlxx/include/mysqlxx/UseQueryResult.h b/base/mysqlxx/include/mysqlxx/UseQueryResult.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/UseQueryResult.h rename to base/mysqlxx/include/mysqlxx/UseQueryResult.h diff --git a/libs/libmysqlxx/include/mysqlxx/Value.h b/base/mysqlxx/include/mysqlxx/Value.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/Value.h rename to base/mysqlxx/include/mysqlxx/Value.h diff --git a/libs/libmysqlxx/include/mysqlxx/mysqlxx.h b/base/mysqlxx/include/mysqlxx/mysqlxx.h similarity index 100% rename from libs/libmysqlxx/include/mysqlxx/mysqlxx.h rename to base/mysqlxx/include/mysqlxx/mysqlxx.h diff --git a/libs/libmysqlxx/src/Connection.cpp b/base/mysqlxx/src/Connection.cpp similarity index 100% rename from libs/libmysqlxx/src/Connection.cpp rename to base/mysqlxx/src/Connection.cpp diff --git a/libs/libmysqlxx/src/Exception.cpp b/base/mysqlxx/src/Exception.cpp similarity index 100% rename from libs/libmysqlxx/src/Exception.cpp rename to base/mysqlxx/src/Exception.cpp diff --git a/libs/libmysqlxx/src/Pool.cpp b/base/mysqlxx/src/Pool.cpp similarity index 100% rename from libs/libmysqlxx/src/Pool.cpp rename to base/mysqlxx/src/Pool.cpp diff --git a/libs/libmysqlxx/src/PoolWithFailover.cpp b/base/mysqlxx/src/PoolWithFailover.cpp similarity index 100% rename from libs/libmysqlxx/src/PoolWithFailover.cpp rename to base/mysqlxx/src/PoolWithFailover.cpp diff --git a/libs/libmysqlxx/src/Query.cpp b/base/mysqlxx/src/Query.cpp similarity index 100% rename from libs/libmysqlxx/src/Query.cpp rename to base/mysqlxx/src/Query.cpp diff --git a/libs/libmysqlxx/src/ResultBase.cpp b/base/mysqlxx/src/ResultBase.cpp similarity index 100% rename from libs/libmysqlxx/src/ResultBase.cpp rename to base/mysqlxx/src/ResultBase.cpp diff --git a/libs/libmysqlxx/src/Row.cpp b/base/mysqlxx/src/Row.cpp similarity index 100% rename from libs/libmysqlxx/src/Row.cpp rename to base/mysqlxx/src/Row.cpp diff --git a/libs/libmysqlxx/src/StoreQueryResult.cpp b/base/mysqlxx/src/StoreQueryResult.cpp similarity index 100% rename from libs/libmysqlxx/src/StoreQueryResult.cpp rename to base/mysqlxx/src/StoreQueryResult.cpp diff --git a/libs/libmysqlxx/src/UseQueryResult.cpp b/base/mysqlxx/src/UseQueryResult.cpp similarity index 100% rename from libs/libmysqlxx/src/UseQueryResult.cpp rename to base/mysqlxx/src/UseQueryResult.cpp diff --git a/libs/libmysqlxx/src/Value.cpp b/base/mysqlxx/src/Value.cpp similarity index 100% rename from libs/libmysqlxx/src/Value.cpp rename to base/mysqlxx/src/Value.cpp diff --git a/libs/libmysqlxx/src/tests/CMakeLists.txt b/base/mysqlxx/src/tests/CMakeLists.txt similarity index 100% rename from libs/libmysqlxx/src/tests/CMakeLists.txt rename to base/mysqlxx/src/tests/CMakeLists.txt diff --git a/libs/libmysqlxx/src/tests/failover.xml b/base/mysqlxx/src/tests/failover.xml similarity index 100% rename from libs/libmysqlxx/src/tests/failover.xml rename to base/mysqlxx/src/tests/failover.xml diff --git a/libs/libmysqlxx/src/tests/mysqlxx_test.cpp b/base/mysqlxx/src/tests/mysqlxx_test.cpp similarity index 100% rename from libs/libmysqlxx/src/tests/mysqlxx_test.cpp rename to base/mysqlxx/src/tests/mysqlxx_test.cpp diff --git a/libs/libcommon/include/port/clock.h b/base/port/clock.h similarity index 100% rename from libs/libcommon/include/port/clock.h rename to base/port/clock.h diff --git a/libs/libcommon/include/port/ssize_t.h b/base/port/ssize_t.h similarity index 100% rename from libs/libcommon/include/port/ssize_t.h rename to base/port/ssize_t.h diff --git a/libs/libcommon/include/port/unistd.h b/base/port/unistd.h similarity index 100% rename from libs/libcommon/include/port/unistd.h rename to base/port/unistd.h diff --git a/libs/libwidechar_width/CMakeLists.txt b/base/widechar_width/CMakeLists.txt similarity index 100% rename from libs/libwidechar_width/CMakeLists.txt rename to base/widechar_width/CMakeLists.txt diff --git a/libs/libwidechar_width/LICENSE b/base/widechar_width/LICENSE similarity index 100% rename from libs/libwidechar_width/LICENSE rename to base/widechar_width/LICENSE diff --git a/libs/libwidechar_width/README.md b/base/widechar_width/README.md similarity index 100% rename from libs/libwidechar_width/README.md rename to base/widechar_width/README.md diff --git a/libs/libwidechar_width/widechar_width.cpp b/base/widechar_width/widechar_width.cpp similarity index 100% rename from libs/libwidechar_width/widechar_width.cpp rename to base/widechar_width/widechar_width.cpp diff --git a/libs/libwidechar_width/widechar_width.h b/base/widechar_width/widechar_width.h similarity index 100% rename from libs/libwidechar_width/widechar_width.h rename to base/widechar_width/widechar_width.h diff --git a/libs/libcommon/cmake/find_cctz.cmake b/cmake/find/cctz.cmake similarity index 100% rename from libs/libcommon/cmake/find_cctz.cmake rename to cmake/find/cctz.cmake diff --git a/libs/libcommon/cmake/find_jemalloc.cmake b/cmake/find/jemalloc.cmake similarity index 100% rename from libs/libcommon/cmake/find_jemalloc.cmake rename to cmake/find/jemalloc.cmake diff --git a/libs/libmysqlxx/cmake/find_mysqlclient.cmake b/cmake/find/mysqlclient.cmake similarity index 100% rename from libs/libmysqlxx/cmake/find_mysqlclient.cmake rename to cmake/find/mysqlclient.cmake diff --git a/cmake/lib_name.cmake b/cmake/lib_name.cmake index 847efb15fc5..a793e8a1163 100644 --- a/cmake/lib_name.cmake +++ b/cmake/lib_name.cmake @@ -1,5 +1,5 @@ set(DIVIDE_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libdivide) -set(COMMON_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/libs/libcommon/include ${ClickHouse_BINARY_DIR}/libs/libcommon/include) +set(COMMON_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/base ${ClickHouse_BINARY_DIR}/base) set(DBMS_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/dbms/src ${ClickHouse_BINARY_DIR}/dbms/src) set(DOUBLE_CONVERSION_CONTRIB_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/double-conversion) set(METROHASH_CONTRIB_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src) diff --git a/cmake/linux/default_libs.cmake b/cmake/linux/default_libs.cmake index 6ecc3e96593..d18a996e2c9 100644 --- a/cmake/linux/default_libs.cmake +++ b/cmake/linux/default_libs.cmake @@ -35,7 +35,7 @@ add_library(global-libs INTERFACE) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) -add_subdirectory(libs/libglibc-compatibility) +add_subdirectory(base/glibc-compatibility) include (cmake/find/unwind.cmake) include (cmake/find/cxx.cmake) diff --git a/libs/libcommon/CMakeLists.txt b/libs/libcommon/CMakeLists.txt deleted file mode 100644 index 765ab99bfee..00000000000 --- a/libs/libcommon/CMakeLists.txt +++ /dev/null @@ -1,128 +0,0 @@ -set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/include/common/config_common.h) -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/include/common/config_common.h.in ${CONFIG_COMMON}) - -add_library(apple_rt - src/apple_rt.cpp - include/port/clock.h -) -target_include_directories (apple_rt PUBLIC ${COMMON_INCLUDE_DIR}) -if (DEFINED APPLE_HAVE_CLOCK_GETTIME) - target_compile_definitions(apple_rt PUBLIC -DAPPLE_HAVE_CLOCK_GETTIME=${APPLE_HAVE_CLOCK_GETTIME}) -endif () - -set (COMMON_SRCS - src/argsToConfig.cpp - src/coverage.cpp - src/DateLUT.cpp - src/DateLUTImpl.cpp - src/demangle.cpp - src/getMemoryAmount.cpp - src/getThreadId.cpp - src/JSON.cpp - src/LineReader.cpp - src/mremap.cpp - src/phdr_cache.cpp - src/preciseExp10.c - src/setTerminalEcho.cpp - src/shift10.cpp - src/sleep.cpp - - include/common/constexpr_helpers.h - include/common/coverage.h - include/common/DateLUT.h - include/common/DateLUTImpl.h - include/common/DayNum.h - include/common/demangle.h - include/common/ErrorHandlers.h - include/common/find_symbols.h - include/common/getMemoryAmount.h - include/common/getThreadId.h - include/common/JSON.h - include/common/likely.h - include/common/LineReader.h - include/common/LocalDate.h - include/common/LocalDateTime.h - include/common/logger_useful.h - include/common/mremap.h - include/common/phdr_cache.h - include/common/preciseExp10.h - include/common/setTerminalEcho.h - include/common/shift10.h - include/common/SimpleCache.h - include/common/SimpleCache.h - include/common/sleep.h - include/common/strong_typedef.h - include/common/Types.h - - include/ext/bit_cast.h - include/ext/chrono_io.h - include/ext/collection_cast.h - include/ext/enumerate.h - include/ext/function_traits.h - include/ext/identity.h - include/ext/map.h - include/ext/push_back.h - include/ext/range.h - include/ext/scope_guard.h - include/ext/size.h - include/ext/unlock_guard.h -) - -if (ENABLE_REPLXX) - set (COMMON_SRCS - src/ReplxxLineReader.cpp - include/common/ReplxxLineReader.h - - ${COMMON_SRCS} - ) -endif () - -add_library (common - ${COMMON_SRCS} - ${CONFIG_COMMON}) - -if (USE_INTERNAL_MEMCPY) - set (MEMCPY_LIBRARIES memcpy) -endif () - -find_package (Threads) - -if(CCTZ_INCLUDE_DIR) - target_include_directories(common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR}) -endif() - -target_include_directories (common PUBLIC ${COMMON_INCLUDE_DIR}) - -if (NOT USE_INTERNAL_BOOST_LIBRARY) - target_include_directories (common SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) -endif () - -if(NOT USE_INTERNAL_POCO_LIBRARY) - target_include_directories (common SYSTEM BEFORE PUBLIC ${Poco_Foundation_INCLUDE_DIR}) -endif() - -if(CCTZ_LIBRARY) - target_link_libraries(common PRIVATE ${CCTZ_LIBRARY}) -endif() - -if (ENABLE_REPLXX) - target_link_libraries(common PUBLIC replxx) -endif () - -target_link_libraries (common - PUBLIC - ${Poco_Util_LIBRARY} - ${Poco_Foundation_LIBRARY} - ${CITYHASH_LIBRARIES} - PUBLIC - ${Boost_SYSTEM_LIBRARY} - PRIVATE - ${MEMCPY_LIBRARIES}) - -if (RT_LIBRARY) - target_link_libraries (common PRIVATE ${RT_LIBRARY}) -endif () - -if (ENABLE_TESTS) - add_subdirectory (src/tests) -endif () From 4cedd4619db126984fd362a1a094d5a99e484f2b Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Sun, 16 Feb 2020 11:04:03 +0300 Subject: [PATCH 2/4] Code clean-up --- CMakeLists.txt | 4 +++ base/CMakeLists.txt | 5 --- base/common/CMakeLists.txt | 41 +++++++++------------- cmake/add_warning.cmake | 15 ++++++-- cmake/lib_name.cmake | 1 - dbms/CMakeLists.txt | 8 ----- dbms/programs/CMakeLists.txt | 1 - dbms/src/AggregateFunctions/CMakeLists.txt | 1 - utils/CMakeLists.txt | 5 --- 9 files changed, 33 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bd77cb1fcc..436e2cec6d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,10 @@ endif () # Using system libs can cause a lot of warnings in includes (on macro expansion). if (UNBUNDLED OR NOT (OS_LINUX OR OS_DARWIN) OR ARCH_32) option (NO_WERROR "Disable -Werror compiler option" ON) + + if (NOT NO_WERROR) + add_warning(error) + endif () endif () # Make this extra-checks for correct library dependencies. diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index 4cc9cb51670..cca578815e0 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -1,8 +1,3 @@ -if (NOT NO_WERROR) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -endif () - if (USE_DEBUG_HELPERS) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/common/iostream_debug_helpers.h") endif () diff --git a/base/common/CMakeLists.txt b/base/common/CMakeLists.txt index 7990ef74a57..32aa25e40ea 100644 --- a/base/common/CMakeLists.txt +++ b/base/common/CMakeLists.txt @@ -1,13 +1,12 @@ -set (CONFIG_COMMON ${CMAKE_CURRENT_BINARY_DIR}/config_common.h) -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/config_common.h.in ${CONFIG_COMMON}) +configure_file (config_common.h.in config_common.h) add_library(apple_rt apple_rt.cpp) -target_include_directories (apple_rt PUBLIC ${COMMON_INCLUDE_DIR}) +target_include_directories(apple_rt PRIVATE ..) # TODO: replace with proper header-only target. if (DEFINED APPLE_HAVE_CLOCK_GETTIME) target_compile_definitions(apple_rt PUBLIC -DAPPLE_HAVE_CLOCK_GETTIME=${APPLE_HAVE_CLOCK_GETTIME}) endif () -set (COMMON_SRCS +set (SRCS argsToConfig.cpp coverage.cpp DateLUT.cpp @@ -26,30 +25,24 @@ set (COMMON_SRCS ) if (ENABLE_REPLXX) - set (COMMON_SRCS + set (SRCS ${SRCS} ReplxxLineReader.cpp ReplxxLineReader.h - - ${COMMON_SRCS} ) endif () -add_library (common - ${COMMON_SRCS} - ${CONFIG_COMMON}) +add_library (common ${SRCS}) + +target_include_directories(common PUBLIC .. ${CMAKE_CURRENT_BINARY_DIR}/..) if (USE_INTERNAL_MEMCPY) set (MEMCPY_LIBRARIES memcpy) endif () -find_package (Threads) - if(CCTZ_INCLUDE_DIR) target_include_directories(common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR}) endif() -target_include_directories (common PUBLIC ${COMMON_INCLUDE_DIR}) - if (NOT USE_INTERNAL_BOOST_LIBRARY) target_include_directories (common SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) endif () @@ -62,19 +55,17 @@ if(CCTZ_LIBRARY) target_link_libraries(common PRIVATE ${CCTZ_LIBRARY}) endif() -if (ENABLE_REPLXX) - target_link_libraries(common PUBLIC replxx) -endif () +target_link_libraries(common PUBLIC replxx) target_link_libraries (common - PUBLIC - ${Poco_Util_LIBRARY} - ${Poco_Foundation_LIBRARY} - ${CITYHASH_LIBRARIES} - PUBLIC - ${Boost_SYSTEM_LIBRARY} - PRIVATE - ${MEMCPY_LIBRARIES}) + PUBLIC + ${Poco_Util_LIBRARY} + ${Poco_Foundation_LIBRARY} + ${CITYHASH_LIBRARIES} + ${Boost_SYSTEM_LIBRARY} + PRIVATE + ${MEMCPY_LIBRARIES} +) if (RT_LIBRARY) target_link_libraries (common PRIVATE ${RT_LIBRARY}) diff --git a/cmake/add_warning.cmake b/cmake/add_warning.cmake index 9bf2b1b5e93..3a776c98ab6 100644 --- a/cmake/add_warning.cmake +++ b/cmake/add_warning.cmake @@ -1,15 +1,26 @@ include (CheckCXXCompilerFlag) +include (CheckCCompilerFlag) # Try to add -Wflag if compiler supports it macro (add_warning flag) string (REPLACE "-" "_" underscored_flag ${flag}) string (REPLACE "+" "x" underscored_flag ${underscored_flag}) - check_cxx_compiler_flag("-W${flag}" SUPPORTS_FLAG_${underscored_flag}) - if (SUPPORTS_FLAG_${underscored_flag}) + + check_cxx_compiler_flag("-W${flag}" SUPPORTS_CXXFLAG_${underscored_flag}) + check_c_compiler_flag("-W${flag}" SUPPORTS_CFLAG_${underscored_flag}) + + if (SUPPORTS_CXXFLAG_${underscored_flag}) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W${flag}") else () message (WARNING "Flag -W${flag} is unsupported") endif () + + if (SUPPORTS_CFLAG_${underscored_flag}) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W${flag}") + else () + message (WARNING "Flag -W${flag} is unsupported") + endif () + endmacro () # Try to add -Wno flag if compiler supports it diff --git a/cmake/lib_name.cmake b/cmake/lib_name.cmake index a793e8a1163..51a424cb4e2 100644 --- a/cmake/lib_name.cmake +++ b/cmake/lib_name.cmake @@ -1,5 +1,4 @@ set(DIVIDE_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libdivide) -set(COMMON_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/base ${ClickHouse_BINARY_DIR}/base) set(DBMS_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/dbms/src ${ClickHouse_BINARY_DIR}/dbms/src) set(DOUBLE_CONVERSION_CONTRIB_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/double-conversion) set(METROHASH_CONTRIB_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/libmetrohash/src) diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index eeda7aa6a1f..30c5f5fddb4 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -36,11 +36,6 @@ if (NOT MSVC) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") endif () -if (NOT NO_WERROR) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -endif () - # Add some warnings that are not available even with -Wall -Wextra -Wpedantic. option (WEVERYTHING "Enables -Weverything option with some exceptions. This is intended for exploration of new compiler warnings that may be found to be useful. Only makes sense for clang." ON) @@ -577,9 +572,6 @@ target_include_directories (clickhouse_common_io PUBLIC ${DBMS_INCLUDE_DIR}) target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${DOUBLE_CONVERSION_INCLUDE_DIR}) -# also for copy_headers.sh: -target_include_directories (clickhouse_common_io BEFORE PRIVATE ${COMMON_INCLUDE_DIR}) - add_subdirectory (programs) add_subdirectory (tests) diff --git a/dbms/programs/CMakeLists.txt b/dbms/programs/CMakeLists.txt index 48fb30a8058..eea7a5f4fbe 100644 --- a/dbms/programs/CMakeLists.txt +++ b/dbms/programs/CMakeLists.txt @@ -112,7 +112,6 @@ if (CLICKHOUSE_SPLIT_BINARY) else () add_executable (clickhouse main.cpp) target_link_libraries (clickhouse PRIVATE clickhouse_common_io string_utils) - target_include_directories (clickhouse BEFORE PRIVATE ${COMMON_INCLUDE_DIR}) target_include_directories (clickhouse PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) if (ENABLE_CLICKHOUSE_SERVER) diff --git a/dbms/src/AggregateFunctions/CMakeLists.txt b/dbms/src/AggregateFunctions/CMakeLists.txt index dbbccc3bc7a..f0abc99811e 100644 --- a/dbms/src/AggregateFunctions/CMakeLists.txt +++ b/dbms/src/AggregateFunctions/CMakeLists.txt @@ -21,7 +21,6 @@ list(REMOVE_ITEM clickhouse_aggregate_functions_headers add_library(clickhouse_aggregate_functions ${clickhouse_aggregate_functions_sources}) target_link_libraries(clickhouse_aggregate_functions PRIVATE dbms PUBLIC ${CITYHASH_LIBRARIES}) -target_include_directories(clickhouse_aggregate_functions PRIVATE ${COMMON_INCLUDE_DIR}) if(ENABLE_TESTS) add_subdirectory(tests) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index fcf56e82b52..44ff7d6e828 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,8 +1,3 @@ -if (NOT NO_WERROR) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") -endif () - if(MAKE_STATIC_LIBRARIES) set(MAX_LINKER_MEMORY 3500) else() From 39ea079034bbf121ee9fce26c4e552828975271e Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Mon, 17 Feb 2020 17:27:09 +0300 Subject: [PATCH 3/4] More clean-up --- CMakeLists.txt | 1 - base/CMakeLists.txt | 4 -- base/common/CMakeLists.txt | 14 +---- base/common/LineReader.cpp | 2 +- base/common/ReplxxLineReader.cpp | 2 +- base/common/apple_rt.cpp | 52 ------------------- base/common/shift10.cpp | 3 +- base/common/time.h | 7 +++ base/daemon/include/daemon/BaseDaemon.h | 2 +- base/port/clock.h | 49 ----------------- base/port/ssize_t.h | 8 --- base/port/unistd.h | 11 ---- cmake/find/rt.cmake | 10 ---- dbms/CMakeLists.txt | 7 --- dbms/programs/benchmark/Benchmark.cpp | 2 +- .../performance-test/PerformanceTestSuite.cpp | 2 +- dbms/src/Common/ShellCommand.cpp | 2 +- dbms/src/Common/Stopwatch.h | 6 +-- dbms/src/Common/Throttler.h | 2 - dbms/src/Common/ZooKeeper/ZooKeeper.h | 2 +- .../ZooKeeper/tests/zkutil_test_commands.cpp | 2 +- dbms/src/Common/randomSeed.cpp | 3 +- dbms/src/Common/tests/Random.cpp | 1 - dbms/src/Common/tests/compact_array.cpp | 2 +- dbms/src/Common/tests/int_hashes_perf.cpp | 5 +- .../Compression/CachedCompressedReadBuffer.h | 1 - .../CompressedReadBufferFromFile.h | 1 - dbms/src/IO/ReadBufferFromFileBase.h | 15 +++--- dbms/src/IO/ReadBufferFromFileDescriptor.h | 4 +- dbms/src/IO/WriteBufferFromFileDescriptor.cpp | 2 +- .../tests/gtest_aio_seek_back_after_eof.cpp | 2 +- dbms/src/IO/tests/read_buffer_aio.cpp | 3 +- dbms/src/Interpreters/ClientInfo.cpp | 2 +- dbms/src/Interpreters/tests/users.cpp | 2 +- .../Formats/Impl/PrettyBlockOutputFormat.cpp | 2 +- dbms/src/Storages/MergeTree/MergeTreeReader.h | 1 - .../tests/remove_symlink_directory.cpp | 2 +- utils/iotest/iotest.cpp | 28 +++++----- utils/iotest/iotest_aio.cpp | 2 +- utils/iotest/iotest_nonblock.cpp | 36 +++++++------ 40 files changed, 77 insertions(+), 227 deletions(-) delete mode 100644 base/common/apple_rt.cpp create mode 100644 base/common/time.h delete mode 100644 base/port/clock.h delete mode 100644 base/port/ssize_t.h delete mode 100644 base/port/unistd.h delete mode 100644 cmake/find/rt.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 436e2cec6d8..d2cb6154ee0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,7 +330,6 @@ include (cmake/find/poco.cmake) include (cmake/find/lz4.cmake) include (cmake/find/xxhash.cmake) include (cmake/find/sparsehash.cmake) -include (cmake/find/rt.cmake) include (cmake/find/execinfo.cmake) include (cmake/find/re2.cmake) include (cmake/find/libgsasl.cmake) diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt index cca578815e0..65593f70a95 100644 --- a/base/CMakeLists.txt +++ b/base/CMakeLists.txt @@ -1,7 +1,3 @@ -if (USE_DEBUG_HELPERS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/common/iostream_debug_helpers.h") -endif () - add_subdirectory (common) add_subdirectory (loggers) add_subdirectory (daemon) diff --git a/base/common/CMakeLists.txt b/base/common/CMakeLists.txt index 32aa25e40ea..cce3a28e582 100644 --- a/base/common/CMakeLists.txt +++ b/base/common/CMakeLists.txt @@ -1,11 +1,5 @@ configure_file (config_common.h.in config_common.h) -add_library(apple_rt apple_rt.cpp) -target_include_directories(apple_rt PRIVATE ..) # TODO: replace with proper header-only target. -if (DEFINED APPLE_HAVE_CLOCK_GETTIME) - target_compile_definitions(apple_rt PUBLIC -DAPPLE_HAVE_CLOCK_GETTIME=${APPLE_HAVE_CLOCK_GETTIME}) -endif () - set (SRCS argsToConfig.cpp coverage.cpp @@ -36,7 +30,7 @@ add_library (common ${SRCS}) target_include_directories(common PUBLIC .. ${CMAKE_CURRENT_BINARY_DIR}/..) if (USE_INTERNAL_MEMCPY) - set (MEMCPY_LIBRARIES memcpy) + target_link_libraries (common PRIVATE memcpy) endif () if(CCTZ_INCLUDE_DIR) @@ -63,14 +57,8 @@ target_link_libraries (common ${Poco_Foundation_LIBRARY} ${CITYHASH_LIBRARIES} ${Boost_SYSTEM_LIBRARY} - PRIVATE - ${MEMCPY_LIBRARIES} ) -if (RT_LIBRARY) - target_link_libraries (common PRIVATE ${RT_LIBRARY}) -endif () - if (ENABLE_TESTS) add_subdirectory (tests) endif () diff --git a/base/common/LineReader.cpp b/base/common/LineReader.cpp index 22e0019803d..9dfefcea01f 100644 --- a/base/common/LineReader.cpp +++ b/base/common/LineReader.cpp @@ -3,8 +3,8 @@ #include #include -#include #include +#include #ifdef OS_LINUX /// We can detect if code is linked with one or another readline variants or open the library dynamically. diff --git a/base/common/ReplxxLineReader.cpp b/base/common/ReplxxLineReader.cpp index 044ea05413d..6a0956fb36a 100644 --- a/base/common/ReplxxLineReader.cpp +++ b/base/common/ReplxxLineReader.cpp @@ -1,8 +1,8 @@ #include #include -#include #include +#include namespace { diff --git a/base/common/apple_rt.cpp b/base/common/apple_rt.cpp deleted file mode 100644 index cf260cce604..00000000000 --- a/base/common/apple_rt.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** Allows to build on MacOS X - * - * Highly experimental, not recommended, disabled by default. - * - * To use, include this file with -include compiler parameter. - */ - -#include - -#ifdef __APPLE__ -#if !APPLE_HAVE_CLOCK_GETTIME - -#include -#include -#include -#include -#include -#include - - -int clock_gettime_thread(timespec *spec) { - thread_port_t thread = mach_thread_self(); - - mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; - thread_basic_info_data_t info; - if (KERN_SUCCESS != thread_info(thread, THREAD_BASIC_INFO, reinterpret_cast(&info), &count)) - return -1; - - spec->tv_sec = info.user_time.seconds + info.system_time.seconds; - spec->tv_nsec = info.user_time.microseconds * 1000 + info.system_time.microseconds * 1000; - mach_port_deallocate(mach_task_self(), thread); - - return 0; -} - -int clock_gettime(int clk_id, struct timespec* t) { - if (clk_id == CLOCK_THREAD_CPUTIME_ID) - return clock_gettime_thread(t); - - struct timeval now; - int rv = gettimeofday(&now, NULL); - - if (rv) - return rv; - t->tv_sec = now.tv_sec; - t->tv_nsec = now.tv_usec * 1000; - - return 0; -} - -#endif -#endif diff --git a/base/common/shift10.cpp b/base/common/shift10.cpp index d837fb064fb..45f5733bd76 100644 --- a/base/common/shift10.cpp +++ b/base/common/shift10.cpp @@ -1,7 +1,8 @@ #include + #include + #include -#include template diff --git a/base/common/time.h b/base/common/time.h new file mode 100644 index 00000000000..9a52d8e40b8 --- /dev/null +++ b/base/common/time.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +#if defined (OS_DARWIN) +# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC +#endif diff --git a/base/daemon/include/daemon/BaseDaemon.h b/base/daemon/include/daemon/BaseDaemon.h index 6a2764db8c1..b7070c76e9b 100644 --- a/base/daemon/include/daemon/BaseDaemon.h +++ b/base/daemon/include/daemon/BaseDaemon.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/base/port/clock.h b/base/port/clock.h deleted file mode 100644 index 552d56ede0d..00000000000 --- a/base/port/clock.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once -/** Allows to build on MacOS X - * - * Highly experimental, not recommended, disabled by default. - * - * To use, include this file with -include compiler parameter. - */ - -#include - -#ifdef __APPLE__ - -# if !defined(APPLE_HAVE_CLOCK_GETTIME) -# include -# if !defined(MAC_OS_X_VERSION_10_12) -# define MAC_OS_X_VERSION_10_12 101200 -# endif -# define APPLE_HAVE_CLOCK_GETTIME MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12 -# endif - -# if !APPLE_HAVE_CLOCK_GETTIME || !defined(CLOCK_MONOTONIC) -/** - * MacOS X doesn't support different clock sources - * - * Mapping all of them to 0, except for - * CLOCK_THREAD_CPUTIME_ID, because there is a way - * to implement it using in-kernel stats about threads - */ -# if !defined(CLOCK_MONOTONIC) -# define CLOCK_MONOTONIC 0 -# endif -# if !defined(CLOCK_REALTIME) -# define CLOCK_REALTIME CLOCK_MONOTONIC -# endif -# if !defined(CLOCK_THREAD_CPUTIME_ID) -# define CLOCK_THREAD_CPUTIME_ID 3 -# endif - -typedef int clockid_t; -int clock_gettime(int clk_id, struct timespec* t); -# else - -# endif - -# if !defined(CLOCK_MONOTONIC_COARSE) -# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC -# endif - -#endif diff --git a/base/port/ssize_t.h b/base/port/ssize_t.h deleted file mode 100644 index 62199bbe1f0..00000000000 --- a/base/port/ssize_t.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#ifdef _MSC_VER - #include - typedef SSIZE_T ssize_t; -#else - #include -#endif diff --git a/base/port/unistd.h b/base/port/unistd.h deleted file mode 100644 index 2c08bd0bcd2..00000000000 --- a/base/port/unistd.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -// https://stackoverflow.com/questions/341817/is-there-a-replacement-for-unistd-h-for-windows-visual-c - -#ifdef _MSC_VER - #include -#else - #include -#endif - -#include "ssize_t.h" diff --git a/cmake/find/rt.cmake b/cmake/find/rt.cmake deleted file mode 100644 index 25614fe55eb..00000000000 --- a/cmake/find/rt.cmake +++ /dev/null @@ -1,10 +0,0 @@ -if (APPLE) - # lib from libs/libcommon - set (RT_LIBRARY "apple_rt") -elseif (OS_FREEBSD) - find_library (RT_LIBRARY rt) -else () - set (RT_LIBRARY "") -endif () - -message(STATUS "Using rt: ${RT_LIBRARY}") diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index 30c5f5fddb4..0af6955eab0 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -185,11 +185,6 @@ elseif (COMPILER_GCC) add_cxx_compile_options(-Wvector-operation-performance) endif () -if (USE_DEBUG_HELPERS) - set (INCLUDE_DEBUG_HELPERS "-I${ClickHouse_SOURCE_DIR}/libs/libcommon/include -include ${ClickHouse_SOURCE_DIR}/dbms/src/Core/iostream_debug_helpers.h") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${INCLUDE_DEBUG_HELPERS}") -endif () - if (COMPILER_GCC) # If we leave this optimization enabled, gcc-7 replaces a pair of SSE intrinsics (16 byte load, store) with a call to memcpy. # It leads to slow code. This is compiler bug. It looks like this: @@ -389,8 +384,6 @@ target_link_libraries(clickhouse_common_io PUBLIC ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} - PRIVATE - apple_rt PUBLIC roaring ) diff --git a/dbms/programs/benchmark/Benchmark.cpp b/dbms/programs/benchmark/Benchmark.cpp index 3dd89cd1710..440d07f8ad3 100644 --- a/dbms/programs/benchmark/Benchmark.cpp +++ b/dbms/programs/benchmark/Benchmark.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/dbms/programs/performance-test/PerformanceTestSuite.cpp b/dbms/programs/performance-test/PerformanceTestSuite.cpp index fbf43bfa29f..73ae2ae90ed 100644 --- a/dbms/programs/performance-test/PerformanceTestSuite.cpp +++ b/dbms/programs/performance-test/PerformanceTestSuite.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/dbms/src/Common/ShellCommand.cpp b/dbms/src/Common/ShellCommand.cpp index dd99221d4f7..706d5bfbece 100644 --- a/dbms/src/Common/ShellCommand.cpp +++ b/dbms/src/Common/ShellCommand.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include namespace diff --git a/dbms/src/Common/Stopwatch.h b/dbms/src/Common/Stopwatch.h index 6db345c219a..db337355e2d 100644 --- a/dbms/src/Common/Stopwatch.h +++ b/dbms/src/Common/Stopwatch.h @@ -1,9 +1,9 @@ #pragma once -#include -#include +#include #include -#include + +#include namespace StopWatchDetail diff --git a/dbms/src/Common/Throttler.h b/dbms/src/Common/Throttler.h index a23b0f9db22..172cce783d8 100644 --- a/dbms/src/Common/Throttler.h +++ b/dbms/src/Common/Throttler.h @@ -1,6 +1,5 @@ #pragma once -#include /// nanosleep #include #include #include @@ -8,7 +7,6 @@ #include #include #include -#include namespace ProfileEvents diff --git a/dbms/src/Common/ZooKeeper/ZooKeeper.h b/dbms/src/Common/ZooKeeper/ZooKeeper.h index 5bae272102d..c553d162c2b 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeper.h +++ b/dbms/src/Common/ZooKeeper/ZooKeeper.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace ProfileEvents diff --git a/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp b/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp index a49a5cf1a6d..490c834eab9 100644 --- a/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp +++ b/dbms/src/Common/ZooKeeper/tests/zkutil_test_commands.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include using namespace zkutil; diff --git a/dbms/src/Common/randomSeed.cpp b/dbms/src/Common/randomSeed.cpp index 8402fa4acf8..4d466d283c9 100644 --- a/dbms/src/Common/randomSeed.cpp +++ b/dbms/src/Common/randomSeed.cpp @@ -1,11 +1,10 @@ #include -#include +#include #include #include #include #include #include -#include namespace DB diff --git a/dbms/src/Common/tests/Random.cpp b/dbms/src/Common/tests/Random.cpp index d926b21c133..5264a2d9adc 100644 --- a/dbms/src/Common/tests/Random.cpp +++ b/dbms/src/Common/tests/Random.cpp @@ -1,6 +1,5 @@ /// Taken from SMHasher. #include "Random.h" -#include Rand g_rand1(1); Rand g_rand2(2); diff --git a/dbms/src/Common/tests/compact_array.cpp b/dbms/src/Common/tests/compact_array.cpp index e238263c801..91fb59d543f 100644 --- a/dbms/src/Common/tests/compact_array.cpp +++ b/dbms/src/Common/tests/compact_array.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace fs = std::filesystem; diff --git a/dbms/src/Common/tests/int_hashes_perf.cpp b/dbms/src/Common/tests/int_hashes_perf.cpp index 5f028cbbde8..69020178bd4 100644 --- a/dbms/src/Common/tests/int_hashes_perf.cpp +++ b/dbms/src/Common/tests/int_hashes_perf.cpp @@ -1,5 +1,5 @@ -#if !defined(__APPLE__) && !defined(__FreeBSD__) -#include +#if defined (OS_LINUX) +# include #endif #include @@ -9,7 +9,6 @@ #include #include #include "AvalancheTest.h" /// Taken from SMHasher. -#include static void setAffinity() diff --git a/dbms/src/Compression/CachedCompressedReadBuffer.h b/dbms/src/Compression/CachedCompressedReadBuffer.h index 52ef750ff19..8821a824a0f 100644 --- a/dbms/src/Compression/CachedCompressedReadBuffer.h +++ b/dbms/src/Compression/CachedCompressedReadBuffer.h @@ -5,7 +5,6 @@ #include #include "CompressedReadBufferBase.h" #include -#include namespace DB diff --git a/dbms/src/Compression/CompressedReadBufferFromFile.h b/dbms/src/Compression/CompressedReadBufferFromFile.h index 641e3d6ed1b..191368da3d4 100644 --- a/dbms/src/Compression/CompressedReadBufferFromFile.h +++ b/dbms/src/Compression/CompressedReadBufferFromFile.h @@ -4,7 +4,6 @@ #include #include #include -#include namespace DB diff --git a/dbms/src/IO/ReadBufferFromFileBase.h b/dbms/src/IO/ReadBufferFromFileBase.h index d9e26d80405..4a10215a1a2 100644 --- a/dbms/src/IO/ReadBufferFromFileBase.h +++ b/dbms/src/IO/ReadBufferFromFileBase.h @@ -1,13 +1,14 @@ #pragma once -#include -#include -#include -#include -#include #include -#include -#include "SeekableReadBuffer.h" +#include +#include + +#include +#include + +#include + namespace DB { diff --git a/dbms/src/IO/ReadBufferFromFileDescriptor.h b/dbms/src/IO/ReadBufferFromFileDescriptor.h index b19a04aef18..8b6ffe54158 100644 --- a/dbms/src/IO/ReadBufferFromFileDescriptor.h +++ b/dbms/src/IO/ReadBufferFromFileDescriptor.h @@ -1,8 +1,8 @@ #pragma once -#include #include -#include + +#include namespace DB diff --git a/dbms/src/IO/WriteBufferFromFileDescriptor.cpp b/dbms/src/IO/WriteBufferFromFileDescriptor.cpp index bfa1e9582d3..2891c1b7076 100644 --- a/dbms/src/IO/WriteBufferFromFileDescriptor.cpp +++ b/dbms/src/IO/WriteBufferFromFileDescriptor.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp b/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp index 35c2db70564..22cfffdda05 100644 --- a/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp +++ b/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/dbms/src/IO/tests/read_buffer_aio.cpp b/dbms/src/IO/tests/read_buffer_aio.cpp index adb2f7d5458..62acd069339 100644 --- a/dbms/src/IO/tests/read_buffer_aio.cpp +++ b/dbms/src/IO/tests/read_buffer_aio.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include namespace @@ -670,4 +670,3 @@ int main() run(); return 0; } - diff --git a/dbms/src/Interpreters/ClientInfo.cpp b/dbms/src/Interpreters/ClientInfo.cpp index 3fbc015afe2..743fe934dc3 100644 --- a/dbms/src/Interpreters/ClientInfo.cpp +++ b/dbms/src/Interpreters/ClientInfo.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include namespace DB diff --git a/dbms/src/Interpreters/tests/users.cpp b/dbms/src/Interpreters/tests/users.cpp index 93b1f6c27f1..ca96d6f4568 100644 --- a/dbms/src/Interpreters/tests/users.cpp +++ b/dbms/src/Interpreters/tests/users.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace { diff --git a/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp b/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp index c0b1b2e4ffc..6a3a34278fe 100644 --- a/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp +++ b/dbms/src/Processors/Formats/Impl/PrettyBlockOutputFormat.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/dbms/src/Storages/MergeTree/MergeTreeReader.h b/dbms/src/Storages/MergeTree/MergeTreeReader.h index 65485f950c6..1505b71ef53 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeReader.h +++ b/dbms/src/Storages/MergeTree/MergeTreeReader.h @@ -2,7 +2,6 @@ #include #include -#include namespace DB diff --git a/dbms/src/Storages/tests/remove_symlink_directory.cpp b/dbms/src/Storages/tests/remove_symlink_directory.cpp index b455357863e..ae5fa72fa66 100644 --- a/dbms/src/Storages/tests/remove_symlink_directory.cpp +++ b/dbms/src/Storages/tests/remove_symlink_directory.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/utils/iotest/iotest.cpp b/utils/iotest/iotest.cpp index 8c17163778e..ea7cd439838 100644 --- a/utils/iotest/iotest.cpp +++ b/utils/iotest/iotest.cpp @@ -1,21 +1,23 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include +#include #include #include -#include -#include #include -#include +#include +#include + #include -#include +#include +#include +#include +#include + +#include +#include +#include +#include + namespace DB { diff --git a/utils/iotest/iotest_aio.cpp b/utils/iotest/iotest_aio.cpp index 038bc600ec6..800e605d62e 100644 --- a/utils/iotest/iotest_aio.cpp +++ b/utils/iotest/iotest_aio.cpp @@ -3,7 +3,7 @@ int main(int, char **) { return 0; } #else #include -#include +#include #include #include #include diff --git a/utils/iotest/iotest_nonblock.cpp b/utils/iotest/iotest_nonblock.cpp index 62871f6c162..3d6b8666043 100644 --- a/utils/iotest/iotest_nonblock.cpp +++ b/utils/iotest/iotest_nonblock.cpp @@ -1,24 +1,26 @@ -#include -#include -#include -#include -#include -#if !defined(__APPLE__) && !defined(__FreeBSD__) -#include -#endif -#include -#include -#include -#include -#include -#include #include +#include #include #include -#include -#include #include -#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#if defined (OS_LINUX) +# include +#endif + namespace DB { From 922add62443aaab736771d84fa37c95126adc813 Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Mon, 17 Feb 2020 19:30:25 +0300 Subject: [PATCH 4/4] Fix check-style util --- utils/check-style/check-include | 15 +++++++-------- utils/check-style/format.sh | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/utils/check-style/check-include b/utils/check-style/check-include index 1b1bf3d56e0..3ced75d19d5 100755 --- a/utils/check-style/check-include +++ b/utils/check-style/check-include @@ -45,13 +45,12 @@ inc="-I. \ -I./contrib/capnproto/c++/src \ -I./contrib/unixodbc/include \ -I./contrib/unixodbc-cmake/linux_x86_64 \ --I./libs/libmysqlxx/include \ --I./libs/libcommon/include \ --I${BUILD_DIR}/libs/libcommon/include \ --I./libs/libzkutil/include \ --I./libs/libdaemon/include \ --I./libs/consistent-hashing \ --I./libs/consistent-hashing-sumbur \ +-I./base/mysqlxx \ +-I./base \ +-I${BUILD_DIR}/base \ +-I./base/daemon \ +-I./base/consistent-hashing \ +-I./base/consistent-hashing-sumbur \ -I./contrib/libhdfs3/include \ -I./contrib/base64/include \ -I./contrib/protobuf/src \ @@ -65,7 +64,7 @@ inc="-I. \ if [ -z $1 ]; then cd ${ROOT_DIR=${CUR_DIR}../..} - find dbms libs utils \( -name *.h -and -not -name *.inl.h \) -print0 | xargs -0 -n1 sh $CUR_DIR`basename $0` + find base dbms utils \( -name *.h -and -not -name *.inl.h \) -print0 | xargs -0 -n1 sh $CUR_DIR`basename $0` else echo -n "$1 " echo -n `grep "#include" $1| wc -l` " " diff --git a/utils/check-style/format.sh b/utils/check-style/format.sh index 0e7498fed03..4f8de342c8d 100755 --- a/utils/check-style/format.sh +++ b/utils/check-style/format.sh @@ -6,7 +6,7 @@ cd `readlink -f $(dirname $0)`/../.. clang_format=`bash -c "compgen -c clang-format | grep 'clang-format-[[:digit:]]' | sort --version-sort --reverse | head -n1"` if [ ! -z $clang_format ]; then - find dbms libs utils -name *.cpp -or -name *.h -exec $clang_format -i {} + ; + find base dbms utils -name *.cpp -or -name *.h -exec $clang_format -i {} + ; else echo clang-format missing. try to install: echo sudo apt install clang-format