Skip to content

Commit 955db15

Browse files
committed
feat build: a bunch of fixes for different build issues
Tests: протестировано CI
1 parent d3fc14e commit 955db15

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ option(USERVER_FEATURE_CLICKHOUSE "Provide asynchronous driver for ClickHouse" $
106106
option(USERVER_FEATURE_RABBITMQ "Provide asynchronous driver for RabbitMQ" ON)
107107
option(USERVER_FEATURE_MYSQL "Provide asynchronous driver for MariaDB/MySQL" OFF)
108108
option(USERVER_FEATURE_UNIVERSAL "Provide a universal utilities library that does not use coroutines" ON)
109+
option(USERVER_FEATURE_UBOOST_CORO "Use vendored boost context instead of a system one" ON)
109110

110111
if (USERVER_FEATURE_GRPC)
111112
include(cmake/SetupProtobuf.cmake)
@@ -122,9 +123,17 @@ else()
122123
add_subdirectory("${USERVER_THIRD_PARTY_DIRS}/boost_stacktrace")
123124
endif()
124125

126+
if (USERVER_FEATURE_UBOOST_CORO)
127+
add_subdirectory(uboost_coro)
128+
else()
129+
find_package(Boost REQUIRED COMPONENTS
130+
context
131+
coroutine
132+
)
133+
endif()
134+
125135
add_subdirectory(core "${CMAKE_BINARY_DIR}/userver/core")
126136
add_subdirectory("${USERVER_THIRD_PARTY_DIRS}/compiler-rt")
127-
add_subdirectory(uboost_coro)
128137

129138
if (USERVER_IS_THE_ROOT_PROJECT)
130139
add_subdirectory(tools/engine)

cmake/RequireDWCAS.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ cmake_policy(SET CMP0067 NEW)
7272
try_run(
7373
RUN_RESULT COMPILE_RESULT
7474
"${CMAKE_CURRENT_BINARY_DIR}/require_dwcas"
75-
"${USERVER_ROOT_DIR}/cmake/RequireDWCAS.cpp"
75+
"${CMAKE_CURRENT_LIST_DIR}/RequireDWCAS.cpp"
7676
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${Boost_INCLUDE_DIR}"
7777
COMPILE_DEFINITIONS ${TEST_DEFINITIONS}
7878
LINK_LIBRARIES ${TEST_LIBRARIES}

core/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ set(CMAKE_THREAD_PREFER_PTHREAD ON)
6363
set(THREADS_PREFER_PTHREAD_FLAG ON)
6464
find_package(Threads REQUIRED)
6565
find_package(Boost REQUIRED COMPONENTS
66-
context
67-
coroutine
6866
program_options
6967
filesystem
7068
locale
@@ -147,16 +145,13 @@ if (USERVER_SANITIZE AND NOT CMAKE_BUILD_TYPE MATCHES "^Rel")
147145
target_link_libraries(${PROJECT_NAME} PUBLIC userver-compiler-rt-parts)
148146
endif()
149147

150-
option(USERVER_FEATURE_UBOOST_CORO "Use vendored boost context instead of a system one" ON)
151-
152148
target_link_libraries(${PROJECT_NAME}
153149
PUBLIC
154150
Threads::Threads
155151
Boost::locale
156152
sanitize-target
157153
CURL::libcurl
158154
PRIVATE
159-
Boost::coroutine
160155
Boost::filesystem
161156
Boost::program_options
162157
Boost::iostreams
@@ -166,6 +161,7 @@ target_link_libraries(${PROJECT_NAME}
166161
OpenSSL::SSL
167162
ZLIB::ZLIB
168163
)
164+
169165
if (USERVER_FEATURE_UBOOST_CORO)
170166
target_link_libraries(${PROJECT_NAME}
171167
PRIVATE

core/src/clients/http/client_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,11 +1507,11 @@ UTEST(HttpClient, TestConnectTo) {
15071507
const utest::SimpleServer http_server{cb};
15081508
auto http_client_ptr = utest::CreateHttpClient();
15091509

1510-
clients::http::ConnectTo connect_to("0.0.0.0:0:127.0.0.1:" +
1510+
clients::http::ConnectTo connect_to("0.0.0.0:42:127.0.0.1:" +
15111511
std::to_string(http_server.GetPort()));
15121512
auto request = http_client_ptr->CreateRequest()
15131513
.connect_to(connect_to)
1514-
.post("http://0.0.0.0:0", kTestData)
1514+
.post("http://0.0.0.0:42", kTestData)
15151515
.retry(1)
15161516
.http_version(clients::http::HttpVersion::k11)
15171517
.timeout(kTimeout);

scripts/docs/en/deps/ubuntu-20.04.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ ccache
22
cmake
33
git
44
libbenchmark-dev
5-
libboost-context1.67-dev
6-
libboost-coroutine1.67-dev
7-
libboost-filesystem1.67-dev
8-
libboost-iostreams1.67-dev
9-
libboost-locale1.67-dev
10-
libboost-program-options1.67-dev
11-
libboost-thread1.67-dev
12-
libboost-regex1.67-dev
13-
libboost1.67-dev
5+
libboost-context1.71-dev
6+
libboost-coroutine1.71-dev
7+
libboost-filesystem1.71-dev
8+
libboost-iostreams1.71-dev
9+
libboost-locale1.71-dev
10+
libboost-program-options1.71-dev
11+
libboost-thread1.71-dev
12+
libboost-regex1.71-dev
13+
libboost1.71-dev
1414
libbson-dev
1515
libcctz-dev
1616
libcrypto++-dev

0 commit comments

Comments
 (0)