Skip to content

Commit c569b6b

Browse files
committed
Intermediate changes
1 parent 4069f96 commit c569b6b

File tree

166 files changed

+316
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+316
-233
lines changed

CMakeLists.txt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@ set(YDB-CPP-SDK_AVAILABLE_COMPONENTS "" CACHE INTERNAL "")
1818
set(YDB-CPP-SDK_COMPONENT_TARGETS "" CACHE INTERNAL "")
1919
file(READ "src/client/resources/ydb_sdk_version.txt" YDB_SDK_VERSION)
2020

21-
file(MAKE_DIRECTORY ${YDB_SDK_BINARY_DIR}/ydb-cpp-sdk)
21+
include(GNUInstallDirs)
22+
include(CMakePackageConfigHelpers)
2223

2324
list(APPEND CMAKE_MODULE_PATH ${YDB_SDK_SOURCE_DIR}/cmake)
24-
include_directories(${YDB_SDK_SOURCE_DIR} ${YDB_SDK_SOURCE_DIR}/include ${YDB_SDK_BINARY_DIR})
25-
26-
if (YDB_SDK_INSTALL)
27-
include(GNUInstallDirs)
28-
include(CMakePackageConfigHelpers)
29-
endif()
3025

3126
include(cmake/global_flags.cmake)
3227
include(cmake/global_vars.cmake)
@@ -47,6 +42,8 @@ add_subdirectory(library/cpp)
4742
add_subdirectory(src)
4843
add_subdirectory(util)
4944

45+
_ydb_sdk_validate_public_headers()
46+
5047
if (YDB_SDK_EXAMPLES)
5148
add_subdirectory(examples)
5249
endif()
@@ -57,13 +54,7 @@ if (YDB_SDK_TESTS)
5754
endif()
5855

5956
if (YDB_SDK_INSTALL)
60-
_ydb_sdk_directory_install(DIRECTORY ${YDB_SDK_SOURCE_DIR}/include/ydb-cpp-sdk
61-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
62-
)
63-
_ydb_sdk_directory_install(DIRECTORY ${YDB_SDK_BINARY_DIR}/ydb-cpp-sdk
64-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
65-
PATTERN "*.h"
66-
)
57+
_ydb_sdk_install_headers(${CMAKE_INSTALL_INCLUDEDIR})
6758
install(EXPORT ydb-cpp-sdk-targets
6859
FILE ydb-cpp-sdk-targets.cmake
6960
CONFIGURATIONS RELEASE

cmake/install.cmake

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ function(_ydb_sdk_install_targets)
2222
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
2323
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
2424
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
25-
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
25+
INCLUDES DESTINATION
26+
${CMAKE_INSTALL_INCLUDEDIR}
27+
${CMAKE_INSTALL_INCLUDEDIR}/__ydb_sdk_special_headers
2628
)
2729
endfunction()
2830

@@ -54,3 +56,42 @@ function(_ydb_sdk_directory_install)
5456
endif()
5557
endif()
5658
endfunction()
59+
60+
function(_ydb_sdk_install_headers ArgIncludeDir)
61+
if (NOT ${YDB_SDK_INSTALL})
62+
return()
63+
endif()
64+
_ydb_sdk_directory_install(DIRECTORY ${YDB_SDK_SOURCE_DIR}/include/ydb-cpp-sdk
65+
DESTINATION ${ArgIncludeDir}
66+
)
67+
68+
file(STRINGS ${YDB_SDK_SOURCE_DIR}/cmake/public_headers.txt PublicHeaders)
69+
list(APPEND ProtosPublicHeaders
70+
src/api/protos/ydb_federation_discovery.pb.h
71+
src/api/protos/ydb_value.pb.h
72+
src/api/protos/ydb_query.pb.h
73+
src/api/protos/ydb_topic.pb.h
74+
src/api/protos/ydb_table.pb.h
75+
src/api/protos/ydb_query_stats.pb.h
76+
src/api/protos/ydb_import.pb.h
77+
src/api/protos/ydb_export.pb.h
78+
src/api/protos/ydb_coordination.pb.h
79+
src/api/protos/draft/ydb_replication.pb.h
80+
src/library/operation_id/protos/operation_id.pb.h
81+
src/library/yql/public/issue/protos/issue_severity.pb.h
82+
)
83+
foreach(HeaderPath ${PublicHeaders})
84+
get_filename_component(RelInstallPath ${HeaderPath} DIRECTORY)
85+
_ydb_sdk_directory_install(FILES
86+
${YDB_SDK_SOURCE_DIR}/${HeaderPath}
87+
DESTINATION ${ArgIncludeDir}/__ydb_sdk_special_headers/${RelInstallPath}
88+
)
89+
endforeach()
90+
foreach(HeaderPath ${ProtosPublicHeaders})
91+
get_filename_component(RelInstallPath ${HeaderPath} DIRECTORY)
92+
_ydb_sdk_directory_install(FILES
93+
${YDB_SDK_BINARY_DIR}/${HeaderPath}
94+
DESTINATION ${ArgIncludeDir}/__ydb_sdk_special_headers/${RelInstallPath}
95+
)
96+
endforeach()
97+
endfunction()

cmake/protobuf.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function(_ydb_sdk_gen_proto_messages Tgt Scope Grpc)
4949
endfunction()
5050

5151
function(_ydb_sdk_init_proto_library_impl Tgt USE_API_COMMON_PROTOS)
52-
add_library(${Tgt})
52+
_ydb_sdk_add_library(${Tgt})
5353
target_link_libraries(${Tgt} PUBLIC
5454
protobuf::libprotobuf
5555
)

cmake/public_headers.txt

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
library/cpp/cgiparam/cgiparam.h
2+
library/cpp/containers/stack_vector/stack_vec.h
3+
library/cpp/coroutine/listener/listen.h
4+
library/cpp/deprecated/atomic/atomic.h
5+
library/cpp/deprecated/atomic/atomic_gcc.h
6+
library/cpp/deprecated/atomic/atomic_ops.h
7+
library/cpp/deprecated/atomic/atomic_win.h
8+
library/cpp/http/fetch/exthttpcodes.h
9+
library/cpp/http/fetch/httpheader.h
10+
library/cpp/http/io/headers.h
11+
library/cpp/http/io/stream.h
12+
library/cpp/http/misc/httpcodes.h
13+
library/cpp/http/server/conn.h
14+
library/cpp/http/server/http.h
15+
library/cpp/http/server/options.h
16+
library/cpp/http/server/response.h
17+
library/cpp/iterator/iterate_values.h
18+
library/cpp/iterator/mapped.h
19+
library/cpp/json/common/defs.h
20+
library/cpp/json/fast_sax/parser.h
21+
library/cpp/json/writer/json.h
22+
library/cpp/json/writer/json_value.h
23+
library/cpp/json/json_reader.h
24+
library/cpp/json/json_value.h
25+
library/cpp/logger/backend.h
26+
library/cpp/logger/element.h
27+
library/cpp/logger/log.h
28+
library/cpp/logger/priority.h
29+
library/cpp/logger/record.h
30+
library/cpp/logger/thread.h
31+
library/cpp/mime/types/mime.h
32+
library/cpp/monlib/counters/counters.h
33+
library/cpp/monlib/dynamic_counters/counters.h
34+
library/cpp/monlib/encode/json/json.h
35+
library/cpp/monlib/encode/encoder.h
36+
library/cpp/monlib/encode/format.h
37+
library/cpp/monlib/metrics/histogram_collector.h
38+
library/cpp/monlib/metrics/histogram_snapshot.h
39+
library/cpp/monlib/metrics/labels.h
40+
library/cpp/monlib/metrics/log_histogram_snapshot.h
41+
library/cpp/monlib/metrics/metric.h
42+
library/cpp/monlib/metrics/metric_consumer.h
43+
library/cpp/monlib/metrics/metric_registry.h
44+
library/cpp/monlib/metrics/metric_type.h
45+
library/cpp/monlib/metrics/summary_collector.h
46+
library/cpp/monlib/metrics/summary_snapshot.h
47+
library/cpp/monlib/service/pages/index_mon_page.h
48+
library/cpp/monlib/service/pages/mon_page.h
49+
library/cpp/monlib/service/auth.h
50+
library/cpp/monlib/service/mon_service_http_request.h
51+
library/cpp/monlib/service/monservice.h
52+
library/cpp/monlib/service/service.h
53+
library/cpp/resource/resource.h
54+
library/cpp/threading/future/core/future-inl.h
55+
library/cpp/threading/future/core/future.h
56+
library/cpp/threading/future/core/fwd.h
57+
library/cpp/threading/future/wait/wait-inl.h
58+
library/cpp/threading/future/wait/wait.h
59+
library/cpp/threading/future/wait/wait_group-inl.h
60+
library/cpp/threading/future/wait/wait_group.h
61+
library/cpp/threading/future/future.h
62+
library/cpp/threading/future/fwd.h
63+
library/cpp/yson/consumer.h
64+
library/cpp/yson/public.h
65+
library/cpp/yson/token.h
66+
library/cpp/yson/writer.h
67+
library/cpp/yt/exception/exception.h
68+
library/cpp/yt/misc/enum-inl.h
69+
library/cpp/yt/misc/enum.h
70+
library/cpp/yt/misc/preprocessor-gen.h
71+
library/cpp/yt/misc/preprocessor.h
72+
library/cpp/yt/yson/consumer.h
73+
library/cpp/yt/yson/public.h
74+
library/cpp/yt/yson_string/public.h
175
util/datetime/base.h
276
util/datetime/systime.h
377
util/digest/multi.h
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
add_library(contrib-libs-libc_compat)
1+
_ydb_sdk_add_library(contrib-libs-libc_compat)
22

33
target_compile_options(contrib-libs-libc_compat PRIVATE
44
$<IF:$<CXX_COMPILER_ID:MSVC>,,-Wno-everything>
55
)
66

7-
target_include_directories(contrib-libs-libc_compat PUBLIC
8-
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/include/readpassphrase
9-
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/reallocarray
10-
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/random
11-
)
12-
137
target_sources(contrib-libs-libc_compat PRIVATE
148
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/string.c
15-
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/readpassphrase.c
169
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/explicit_bzero.c
1710
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/memfd_create.c
1811
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/strlcat.c
@@ -21,3 +14,5 @@ target_sources(contrib-libs-libc_compat PRIVATE
2114
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/random/getrandom.c
2215
${YDB_SDK_SOURCE_DIR}/contrib/libs/libc_compat/random/getentropy.c
2316
)
17+
18+
_ydb_sdk_install_targets(TARGETS contrib-libs-libc_compat)

contrib/libs/lzmasdk/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_library(contrib-libs-lzmasdk)
1+
_ydb_sdk_add_library(contrib-libs-lzmasdk)
22

33
target_compile_options(contrib-libs-lzmasdk PRIVATE
44
-D_7ZIP_ST=1

include/ydb-cpp-sdk/client/topic/errors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <ydb-cpp-sdk/client/types/status/status.h>
44
#include <ydb-cpp-sdk/client/types/status_codes.h>
55

6-
#include <src/library/retry/retry_policy.h>
6+
#include <ydb-cpp-sdk/library/retry/retry_policy.h>
77

88
namespace NYdb::NTopic {
99

include/ydb-cpp-sdk/client/topic/retry_policy.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <ydb-cpp-sdk/client/types/status_codes.h>
4-
#include <src/library/retry/retry_policy.h>
4+
#include <ydb-cpp-sdk/library/retry/retry_policy.h>
55
#include <util/generic/ptr.h>
66

77
namespace NYdb::NTopic {

library/cpp/blockcodecs/CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_library(blockcodecs-core)
1+
_ydb_sdk_add_library(blockcodecs-core)
22
target_link_libraries(blockcodecs-core
33
PUBLIC
44
yutil
@@ -10,7 +10,7 @@ target_sources(blockcodecs-core PRIVATE
1010
_ydb_sdk_install_targets(TARGETS blockcodecs-core)
1111

1212

13-
add_library(blockcodecs-codecs-brotli INTERFACE)
13+
_ydb_sdk_add_library(blockcodecs-codecs-brotli INTERFACE)
1414
add_global_library_for(blockcodecs-codecs-brotli.global blockcodecs-codecs-brotli)
1515
target_link_libraries(blockcodecs-codecs-brotli.global
1616
PRIVATE
@@ -27,7 +27,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-brotli.global)
2727
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-brotli)
2828

2929

30-
add_library(blockcodecs-codecs-bzip INTERFACE)
30+
_ydb_sdk_add_library(blockcodecs-codecs-bzip INTERFACE)
3131
add_global_library_for(blockcodecs-codecs-bzip.global blockcodecs-codecs-bzip)
3232
target_link_libraries(blockcodecs-codecs-bzip.global
3333
PRIVATE
@@ -43,7 +43,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-bzip.global)
4343
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-bzip)
4444

4545

46-
add_library(blockcodecs-codecs-fastlz INTERFACE)
46+
_ydb_sdk_add_library(blockcodecs-codecs-fastlz INTERFACE)
4747
add_global_library_for(blockcodecs-codecs-fastlz.global blockcodecs-codecs-fastlz)
4848
target_link_libraries(blockcodecs-codecs-fastlz.global
4949
PRIVATE
@@ -59,7 +59,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-fastlz.global)
5959
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-fastlz)
6060

6161

62-
add_library(blockcodecs-codecs-lz4 INTERFACE)
62+
_ydb_sdk_add_library(blockcodecs-codecs-lz4 INTERFACE)
6363
add_global_library_for(blockcodecs-codecs-lz4.global blockcodecs-codecs-lz4)
6464
target_link_libraries(blockcodecs-codecs-lz4.global
6565
PRIVATE
@@ -79,7 +79,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-lz4.global)
7979
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-lz4)
8080

8181

82-
add_library(blockcodecs-codecs-lzma INTERFACE)
82+
_ydb_sdk_add_library(blockcodecs-codecs-lzma INTERFACE)
8383
add_global_library_for(blockcodecs-codecs-lzma.global blockcodecs-codecs-lzma)
8484
target_link_libraries(blockcodecs-codecs-lzma.global
8585
PRIVATE
@@ -95,7 +95,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-lzma.global)
9595
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-lzma)
9696

9797

98-
add_library(blockcodecs-codecs-snappy INTERFACE)
98+
_ydb_sdk_add_library(blockcodecs-codecs-snappy INTERFACE)
9999
add_global_library_for(blockcodecs-codecs-snappy.global blockcodecs-codecs-snappy)
100100
target_link_libraries(blockcodecs-codecs-snappy.global
101101
PRIVATE
@@ -111,7 +111,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-snappy.global)
111111
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-snappy)
112112

113113

114-
add_library(blockcodecs-codecs-zlib INTERFACE)
114+
_ydb_sdk_add_library(blockcodecs-codecs-zlib INTERFACE)
115115
add_global_library_for(blockcodecs-codecs-zlib.global blockcodecs-codecs-zlib)
116116
target_link_libraries(blockcodecs-codecs-zlib.global
117117
PRIVATE
@@ -127,7 +127,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-zlib.global)
127127
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-zlib)
128128

129129

130-
add_library(blockcodecs-codecs-zstd INTERFACE)
130+
_ydb_sdk_add_library(blockcodecs-codecs-zstd INTERFACE)
131131
add_global_library_for(blockcodecs-codecs-zstd.global blockcodecs-codecs-zstd)
132132
target_link_libraries(blockcodecs-codecs-zstd.global
133133
PRIVATE
@@ -143,7 +143,7 @@ _ydb_sdk_install_targets(TARGETS blockcodecs-codecs-zstd.global)
143143
_ydb_sdk_install_targets(TARGETS blockcodecs-codecs-zstd)
144144

145145

146-
add_library(blockcodecs)
146+
_ydb_sdk_add_library(blockcodecs)
147147
target_link_libraries(blockcodecs
148148
PUBLIC
149149
yutil

library/cpp/build_info/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set(KOSHER_SVN_VERSION "")
44
set(SANDBOX_TASK_ID 0)
55
set(BUILD_TYPE RELEASE)
66

7-
add_library(build_info)
7+
_ydb_sdk_add_library(build_info)
88
target_include_directories(build_info
99
PRIVATE
1010
${YDB_SDK_BINARY_DIR}/library/cpp/build_info

library/cpp/cache/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if (YDB_SDK_TESTS)
22
add_subdirectory(ut)
33
endif()
44

5-
add_library(library-cache)
5+
_ydb_sdk_add_library(library-cache)
66

77
target_link_libraries(library-cache PUBLIC
88
yutil

library/cpp/case_insensitive_string/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (YDB_SDK_TESTS)
1010
)
1111
endif()
1212

13-
add_library(case_insensitive_string)
13+
_ydb_sdk_add_library(case_insensitive_string)
1414

1515
target_link_libraries(case_insensitive_string
1616
PUBLIC

library/cpp/cgiparam/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (YDB_SDK_TESTS)
1010
)
1111
endif()
1212

13-
add_library(cgiparam)
13+
_ydb_sdk_add_library(cgiparam)
1414

1515
target_link_libraries(cgiparam
1616
PUBLIC

library/cpp/charset/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if (YDB_SDK_TESTS)
2626
)
2727
endif()
2828

29-
add_library(charset-lite)
29+
_ydb_sdk_add_library(charset-lite)
3030
target_link_libraries(charset-lite PUBLIC
3131
yutil
3232
)
@@ -42,7 +42,7 @@ target_sources(charset-lite
4242
_ydb_sdk_install_targets(TARGETS charset-lite)
4343

4444

45-
add_library(charset)
45+
_ydb_sdk_add_library(charset)
4646
target_link_libraries(charset
4747
PUBLIC
4848
yutil

library/cpp/colorizer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_library(colorizer)
1+
_ydb_sdk_add_library(colorizer)
22

33
target_link_libraries(colorizer PUBLIC
44
yutil

library/cpp/containers/disjoint_interval_tree/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if (YDB_SDK_TESTS)
22
add_subdirectory(ut)
33
endif()
44

5-
add_library(containers-disjoint_interval_tree)
5+
_ydb_sdk_add_library(containers-disjoint_interval_tree)
66

77
target_link_libraries(containers-disjoint_interval_tree PUBLIC
88
yutil

library/cpp/containers/intrusive_rb_tree/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (YDB_SDK_TESTS)
1010
)
1111
endif()
1212

13-
add_library(containers-intrusive_rb_tree)
13+
_ydb_sdk_add_library(containers-intrusive_rb_tree)
1414

1515
target_link_libraries(containers-intrusive_rb_tree PUBLIC
1616
yutil

0 commit comments

Comments
 (0)