Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace stdlib c++ #86

Merged
merged 17 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 2 additions & 0 deletions .github/actions/prepare_vm/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ runs:
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 16
sudo ln -sf /usr/bin/clang-16 /usr/bin/clang
sudo ln -sf /usr/bin/clang++-16 /usr/bin/clang++
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
tar -xvzf libiconv-1.15.tar.gz
cd libiconv-1.15
Expand Down
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ project(YDB-CPP-SDK LANGUAGES C CXX ASM)

set(BUILD_SHARED_LIBS Off)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS Off)
set(CMAKE_CXX_STANDARD_REQUIRED On)
set(CMAKE_CXX_EXTENSIONS On)
set(YDB_MAX_LINK_JOBS 5 CACHE STRING "Maximum parallel link jobs for Ninja generator")
set_property(GLOBAL PROPERTY JOB_POOLS link_jobs=${YDB_MAX_LINK_JOBS})
set(CMAKE_JOB_POOL_LINK link_jobs)
Expand All @@ -17,16 +18,10 @@ enable_testing()
# Can't set it in cuda.cmake because of CMake policy subdirectory stack rules
cmake_policy(SET CMP0104 OLD)

include(cmake/antlr.cmake)
include(cmake/archive.cmake)
include(cmake/bison.cmake)
include(cmake/common.cmake)
include(cmake/fbs.cmake)
include(cmake/global_flags.cmake)
include(cmake/llvm-tools.cmake)
include(cmake/masm.cmake)
include(cmake/protobuf.cmake)
include(cmake/shared_libs.cmake)
include(cmake/global_vars.cmake)

find_package(IDN REQUIRED)
Expand All @@ -42,4 +37,4 @@ add_subdirectory(util)
add_subdirectory(certs)
add_subdirectory(ydb)
add_subdirectory(client)
# add_subdirectory(examples)
add_subdirectory(examples)
2 changes: 0 additions & 2 deletions certs/CMakeLists.darwin-arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ get_built_tool_path(

add_library(certs INTERFACE)
target_link_libraries(certs INTERFACE
contrib-libs-cxxsupp
yutil
library-cpp-resource
)

add_global_library_for(certs.global certs)
target_link_libraries(certs.global PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-resource
)
Expand Down
2 changes: 0 additions & 2 deletions certs/CMakeLists.darwin-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ get_built_tool_path(

add_library(certs INTERFACE)
target_link_libraries(certs INTERFACE
contrib-libs-cxxsupp
yutil
library-cpp-resource
)

add_global_library_for(certs.global certs)
target_link_libraries(certs.global PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-resource
)
Expand Down
6 changes: 2 additions & 4 deletions certs/CMakeLists.linux-aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ get_built_tool_path(

add_library(certs INTERFACE)
target_link_libraries(certs INTERFACE
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
library-cpp-resource
)

add_global_library_for(certs.global certs)
target_link_libraries(certs.global PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
library-cpp-resource
)
Expand Down
6 changes: 2 additions & 4 deletions certs/CMakeLists.linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ get_built_tool_path(

add_library(certs INTERFACE)
target_link_libraries(certs INTERFACE
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
library-cpp-resource
)

add_global_library_for(certs.global certs)
target_link_libraries(certs.global PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
library-cpp-resource
)
Expand Down
2 changes: 0 additions & 2 deletions certs/CMakeLists.windows-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ get_built_tool_path(

add_library(certs INTERFACE)
target_link_libraries(certs INTERFACE
contrib-libs-cxxsupp
yutil
library-cpp-resource
)

add_global_library_for(certs.global certs)
target_link_libraries(certs.global PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-resource
)
Expand Down
9 changes: 5 additions & 4 deletions clang.toolchain
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(CMAKE_C_COMPILER clang-16)
set(CMAKE_CXX_COMPILER clang++-16)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
# set(CMAKE_CXX_FLAGS "-stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld -rdynamic")
set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld")
set(CMAKE_C_STANDARD_LIBRARIES "-lc -lm")
Expand All @@ -12,5 +13,5 @@ endif()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -UNDEBUG" CACHE STRING "C++ compiler flags")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -UNDEBUG" CACHE STRING "C compiler flags")

set(ENV{CC} clang-16)
set(ENV{CXX} clang++-16)
set(ENV{CC} clang)
set(ENV{CXX} clang++)
3 changes: 1 addition & 2 deletions client/draft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
add_library(cpp-client-draft)

target_link_libraries(cpp-client-draft PUBLIC
contrib-libs-cxxsupp
yutil
api-grpc-draft
cpp-client-ydb_table
Expand All @@ -18,6 +17,6 @@ target_sources(cpp-client-draft PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(cpp-client-draft PUBLIC
contrib-libs-linux-headers

)
endif()
1 change: 0 additions & 1 deletion client/draft/ut/CMakeLists.darwin-arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(ydb-public-sdk-cpp-client-draft-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/draft
)
target_link_libraries(ydb-public-sdk-cpp-client-draft-ut PUBLIC
contrib-libs-cxxsupp
yutil
cpp-testing-unittest_main
cpp-client-draft
Expand Down
1 change: 0 additions & 1 deletion client/draft/ut/CMakeLists.darwin-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(ydb-public-sdk-cpp-client-draft-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/draft
)
target_link_libraries(ydb-public-sdk-cpp-client-draft-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
3 changes: 1 addition & 2 deletions client/draft/ut/CMakeLists.linux-aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ target_include_directories(ydb-public-sdk-cpp-client-draft-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/draft
)
target_link_libraries(ydb-public-sdk-cpp-client-draft-ut PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
cpp-testing-unittest_main
cpp-client-draft
Expand Down
3 changes: 1 addition & 2 deletions client/draft/ut/CMakeLists.linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ target_include_directories(ydb-public-sdk-cpp-client-draft-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/draft
)
target_link_libraries(ydb-public-sdk-cpp-client-draft-ut PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
1 change: 0 additions & 1 deletion client/draft/ut/CMakeLists.windows-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(ydb-public-sdk-cpp-client-draft-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/draft
)
target_link_libraries(ydb-public-sdk-cpp-client-draft-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
3 changes: 1 addition & 2 deletions client/extensions/discovery_mutator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
add_library(client-extensions-discovery_mutator)

target_link_libraries(client-extensions-discovery_mutator PUBLIC
contrib-libs-cxxsupp
yutil
cpp-client-ydb_extension
)
Expand All @@ -14,6 +13,6 @@ target_sources(client-extensions-discovery_mutator PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(client-extensions-discovery_mutator PUBLIC
contrib-libs-linux-headers

)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(client-extensions-discovery_mutator-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/extensions/discovery_mutator
)
target_link_libraries(client-extensions-discovery_mutator-ut PUBLIC
contrib-libs-cxxsupp
yutil
cpp-testing-unittest_main
client-extensions-discovery_mutator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(client-extensions-discovery_mutator-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/extensions/discovery_mutator
)
target_link_libraries(client-extensions-discovery_mutator-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ target_include_directories(client-extensions-discovery_mutator-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/extensions/discovery_mutator
)
target_link_libraries(client-extensions-discovery_mutator-ut PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
cpp-testing-unittest_main
client-extensions-discovery_mutator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ target_include_directories(client-extensions-discovery_mutator-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/extensions/discovery_mutator
)
target_link_libraries(client-extensions-discovery_mutator-ut PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(client-extensions-discovery_mutator-ut PRIVATE
${CMAKE_SOURCE_DIR}/client/extensions/discovery_mutator
)
target_link_libraries(client-extensions-discovery_mutator-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
3 changes: 1 addition & 2 deletions client/extensions/solomon_stats/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
add_library(client-extensions-solomon_stats)

target_link_libraries(client-extensions-solomon_stats PUBLIC
contrib-libs-cxxsupp
yutil
monlib-encode-json
cpp-monlib-metrics
Expand All @@ -17,6 +16,6 @@ target_sources(client-extensions-solomon_stats PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(client-extensions-solomon_stats PUBLIC
contrib-libs-linux-headers

)
endif()
3 changes: 1 addition & 2 deletions client/helpers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
add_library(cpp-client-helpers)

target_link_libraries(cpp-client-helpers PUBLIC
contrib-libs-cxxsupp
yutil
cpp-client-iam
client-ydb_types-credentials
Expand All @@ -14,6 +13,6 @@ target_sources(cpp-client-helpers PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(cpp-client-helpers PUBLIC
contrib-libs-linux-headers

)
endif()
3 changes: 1 addition & 2 deletions client/iam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ add_subdirectory(common)
add_library(cpp-client-iam)

target_link_libraries(cpp-client-iam PUBLIC
contrib-libs-cxxsupp
yutil
client-yc_public-iam
client-iam-common
Expand All @@ -15,6 +14,6 @@ target_sources(cpp-client-iam PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(cpp-client-iam PUBLIC
contrib-libs-linux-headers

)
endif()
3 changes: 1 addition & 2 deletions client/iam/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
add_library(client-iam-common)

target_link_libraries(client-iam-common PUBLIC
contrib-libs-cxxsupp
yutil
library-grpc-client
cpp-http-simple
Expand All @@ -17,6 +16,6 @@ target_sources(client-iam-common PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(client-iam-common PUBLIC
contrib-libs-linux-headers

)
endif()
3 changes: 1 addition & 2 deletions client/iam_private/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
add_library(cpp-client-iam_private)

target_link_libraries(cpp-client-iam_private PUBLIC
contrib-libs-cxxsupp
yutil
client-yc_private-iam
client-iam-common
Expand All @@ -13,6 +12,6 @@ target_sources(cpp-client-iam_private PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(cpp-client-iam_private PUBLIC
contrib-libs-linux-headers

)
endif()
3 changes: 1 addition & 2 deletions client/impl/ydb_endpoints/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
add_library(client-impl-ydb_endpoints)

target_link_libraries(client-impl-ydb_endpoints PUBLIC
contrib-libs-cxxsupp
yutil
cpp-monlib-metrics
api-grpc
Expand All @@ -15,6 +14,6 @@ target_sources(client-impl-ydb_endpoints PRIVATE

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT HAVE_CUDA)
target_link_libraries(client-impl-ydb_endpoints PUBLIC
contrib-libs-linux-headers

)
endif()
1 change: 0 additions & 1 deletion client/impl/ydb_endpoints/ut/CMakeLists.darwin-arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PRIVA
${CMAKE_SOURCE_DIR}/client/impl/ydb_endpoints
)
target_link_libraries(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PUBLIC
contrib-libs-cxxsupp
yutil
cpp-testing-unittest_main
client-impl-ydb_endpoints
Expand Down
1 change: 0 additions & 1 deletion client/impl/ydb_endpoints/ut/CMakeLists.darwin-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_include_directories(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PRIVA
${CMAKE_SOURCE_DIR}/client/impl/ydb_endpoints
)
target_link_libraries(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PUBLIC
contrib-libs-cxxsupp
yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
3 changes: 1 addition & 2 deletions client/impl/ydb_endpoints/ut/CMakeLists.linux-aarch64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ target_include_directories(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PRIVA
${CMAKE_SOURCE_DIR}/client/impl/ydb_endpoints
)
target_link_libraries(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
cpp-testing-unittest_main
client-impl-ydb_endpoints
Expand Down
3 changes: 1 addition & 2 deletions client/impl/ydb_endpoints/ut/CMakeLists.linux-x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ target_include_directories(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PRIVA
${CMAKE_SOURCE_DIR}/client/impl/ydb_endpoints
)
target_link_libraries(ydb-public-sdk-cpp-client-impl-ydb_endpoints-ut PUBLIC
contrib-libs-linux-headers
contrib-libs-cxxsupp

yutil
library-cpp-cpuid_check
cpp-testing-unittest_main
Expand Down
Loading
Loading