Skip to content

Commit 27e76af

Browse files
committed
Merge bitcoin/bitcoin#26294: build: move util/url to common/url
3a0b352 refactor: move url.h/cpp from lib util to lib common (fanquake) 058eb69 build: add missing event cflags to libbitcoin_util (fanquake) Pull request description: Move `util/url` to `common/url`. Also add missing `event_*` flags to `libbitcoin_util`. #26293 + the commit dropping boost cppflags from `libbitcoin_util` shows this issue. i.e: ```bash CXX util/libbitcoin_util_a-url.o util/url.cpp:7:10: fatal error: 'event2/http.h' file not found #include <event2/http.h> ^~~~~~~~~~~~~~~ 1 error generated. ``` ACKs for top commit: hebasto: ACK 3a0b352 ryanofsky: Code review ACK 3a0b352 Tree-SHA512: 600a76fd334267a02d332df9b67891a38d3fd7f5baf8a82b2447879b3bc65eab2552d2c081c0a5f1ec927bf80df7fc1f0cbbdda4cb76994b46dadf260b8e1cb3
2 parents d08b63b + 3a0b352 commit 27e76af

File tree

14 files changed

+23
-18
lines changed

14 files changed

+23
-18
lines changed

build_msvc/bitcoin-cli/bitcoin-cli.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
<ProjectReference Include="..\libbitcoin_cli\libbitcoin_cli.vcxproj">
1616
<Project>{0667528c-d734-4009-adf9-c0d6c4a5a5a6}</Project>
1717
</ProjectReference>
18+
<ProjectReference Include="..\libbitcoin_common\libbitcoin_common.vcxproj">
19+
<Project>{7c87e378-df58-482e-aa2f-1bc129bc19ce}</Project>
20+
</ProjectReference>
1821
<ProjectReference Include="..\libbitcoin_crypto\libbitcoin_crypto.vcxproj">
1922
<Project>{6190199c-6cf4-4dad-bfbd-93fa72a760c1}</Project>
2023
</ProjectReference>

build_msvc/libbitcoin_common/libbitcoin_common.vcxproj.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<ConfigurationType>StaticLibrary</ConfigurationType>
99
</PropertyGroup>
1010
<ItemGroup>
11+
<ClCompile Include="..\..\src\common\url.cpp" />
1112
@SOURCE_FILES@
1213
</ItemGroup>
1314
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

build_msvc/libbitcoin_util/libbitcoin_util.vcxproj.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<ConfigurationType>StaticLibrary</ConfigurationType>
99
</PropertyGroup>
1010
<ItemGroup>
11-
<ClCompile Include="..\..\src\util\url.cpp" />
1211
@SOURCE_FILES@
1312
</ItemGroup>
1413
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

ci/test/06_script_b.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
4040
( CI_EXEC run-clang-tidy -quiet "${MAKEJOBS}" ) | grep -C5 "error"
4141
export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/"
4242
CI_EXEC "python3 ${DIR_IWYU}/include-what-you-use/iwyu_tool.py"\
43+
" src/common/url.cpp"\
4344
" src/compat"\
4445
" src/dbwrapper.cpp"\
4546
" src/init"\
@@ -68,7 +69,6 @@ if [ "${RUN_TIDY}" = "true" ]; then
6869
" src/util/strencodings.cpp"\
6970
" src/util/string.cpp"\
7071
" src/util/syserror.cpp"\
71-
" src/util/url.cpp"\
7272
" src/zmq"\
7373
" -p . ${MAKEJOBS} -- -Xiwyu --cxx17ns -Xiwyu --mapping_file=${BASE_BUILD_DIR}/bitcoin-$HOST/contrib/devtools/iwyu/bitcoin.core.imp"
7474
fi

src/Makefile.am

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ BITCOIN_CORE_H = \
134134
coins.h \
135135
common/bloom.h \
136136
common/run_command.h \
137+
common/url.h \
137138
compat/assumptions.h \
138139
compat/byteswap.h \
139140
compat/compat.h \
@@ -303,7 +304,6 @@ BITCOIN_CORE_H = \
303304
util/translation.h \
304305
util/types.h \
305306
util/ui_change_type.h \
306-
util/url.h \
307307
util/vector.h \
308308
validation.h \
309309
validationinterface.h \
@@ -662,6 +662,11 @@ libbitcoin_common_a_SOURCES = \
662662
script/standard.cpp \
663663
warnings.cpp \
664664
$(BITCOIN_CORE_H)
665+
666+
if USE_LIBEVENT
667+
libbitcoin_common_a_CPPFLAGS += $(EVENT_CFLAGS)
668+
libbitcoin_common_a_SOURCES += common/url.cpp
669+
endif
665670
#
666671

667672
# util #
@@ -708,10 +713,6 @@ libbitcoin_util_a_SOURCES = \
708713
util/time.cpp \
709714
util/tokenpipe.cpp \
710715
$(BITCOIN_CORE_H)
711-
712-
if USE_LIBEVENT
713-
libbitcoin_util_a_SOURCES += util/url.cpp
714-
endif
715716
#
716717

717718
# cli #
@@ -775,6 +776,7 @@ endif
775776
bitcoin_cli_LDADD = \
776777
$(LIBBITCOIN_CLI) \
777778
$(LIBUNIVALUE) \
779+
$(LIBBITCOIN_COMMON) \
778780
$(LIBBITCOIN_UTIL) \
779781
$(LIBBITCOIN_CRYPTO)
780782

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <chainparamsbase.h>
1111
#include <clientversion.h>
12+
#include <common/url.h>
1213
#include <compat/compat.h>
1314
#include <compat/stdin.h>
1415
#include <policy/feerate.h>
@@ -21,7 +22,6 @@
2122
#include <util/strencodings.h>
2223
#include <util/system.h>
2324
#include <util/translation.h>
24-
#include <util/url.h>
2525

2626
#include <algorithm>
2727
#include <chrono>

src/bitcoin-wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <chainparams.h>
1010
#include <chainparamsbase.h>
1111
#include <clientversion.h>
12+
#include <common/url.h>
1213
#include <compat/compat.h>
1314
#include <interfaces/init.h>
1415
#include <key.h>
@@ -17,7 +18,6 @@
1718
#include <tinyformat.h>
1819
#include <util/system.h>
1920
#include <util/translation.h>
20-
#include <util/url.h>
2121
#include <wallet/wallettool.h>
2222

2323
#include <exception>

src/bitcoind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <chainparams.h>
1111
#include <clientversion.h>
12+
#include <common/url.h>
1213
#include <compat/compat.h>
1314
#include <init.h>
1415
#include <interfaces/chain.h>
@@ -25,7 +26,6 @@
2526
#include <util/threadnames.h>
2627
#include <util/tokenpipe.h>
2728
#include <util/translation.h>
28-
#include <util/url.h>
2929

3030
#include <any>
3131
#include <functional>

src/util/url.cpp renamed to src/common/url.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <util/url.h>
5+
#include <common/url.h>
66

77
#include <event2/http.h>
88

src/util/url.h renamed to src/common/url.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_UTIL_URL_H
6-
#define BITCOIN_UTIL_URL_H
5+
#ifndef BITCOIN_COMMON_URL_H
6+
#define BITCOIN_COMMON_URL_H
77

88
#include <string>
99

1010
using UrlDecodeFn = std::string(const std::string& url_encoded);
1111
UrlDecodeFn urlDecode;
1212
extern UrlDecodeFn* const URL_DECODE;
1313

14-
#endif // BITCOIN_UTIL_URL_H
14+
#endif // BITCOIN_COMMON_URL_H

0 commit comments

Comments
 (0)