merge-script
eb51963d87
Merge bitcoin/bitcoin#31884: cmake: Make implicit libbitcoinkernel dependencies explicit
3b42e05aa9 cmake: Make implicit `libbitcoinkernel` dependencies explicit (Hennadii Stepanov)
3fd64efb43 cmake: Avoid using `OBJECT` libraries (Hennadii Stepanov)
Pull request description:
This PR fixes two regressions introduced in https://github.com/bitcoin/bitcoin/pull/30911.
For example, on the master branch @ 28dec6c5f8:
- first regression:
```
$ cmake -B build -G "Ninja" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
$ cmake --build build -j $(nproc) -t libbitcoinkernel
$ cmake --install build --component libbitcoinkernel
- Install configuration: "RelWithDebInfo"
CMake Error at build/src/kernel/cmake_install.cmake:46 (file):
file INSTALL cannot find
"/home/hebasto/dev/bitcoin/build/src/crypto/libbitcoin_crypto.a": No such
file or directory.
Call Stack (most recent call first):
build/src/cmake_install.cmake:172 (include)
build/cmake_install.cmake:57 (include)
```
- second regression:
```
$ cmake -B build -G "Unix Makefiles" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
$ cmake --build build -j $(nproc) -t libbitcoinkernel
...
gmake[3]: *** No rule to make target 'src/CMakeFiles/bitcoin_clientversion.dir/clientversion.cpp.o', needed by 'src/kernel/libbitcoinkernel.a'. Stop.
gmake[2]: *** [CMakeFiles/Makefile2:1360: src/kernel/CMakeFiles/bitcoinkernel.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:1367: src/kernel/CMakeFiles/bitcoinkernel.dir/rule] Error 2
gmake: *** [Makefile:647: bitcoinkernel] Error 2
```
With this PR:
```
$ cmake -B build -G "Ninja" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
$ cmake --build build -j $(nproc) -t libbitcoinkernel
$ cmake --install build --component libbitcoinkernel
```
and
```
$ cmake -B build -G "Unix Makefiles" -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/home/hebasto/INSTALL
$ cmake --build build -j $(nproc) -t libbitcoinkernel
$ cmake --install build --component libbitcoinkernel
```
---
**A note for reviewers:** An alternative approach would be to disable the `OPTIMIZE_DEPENDENCIES` property for the `bitcoinkernel` target. However, I contend that this PR is preferable because (1) it preserves parallel builds for the `libbitcoinkernel` target, and (2) the resulting code has one less workaround for a CMake bug.
ACKs for top commit:
TheCharlatan:
ACK 3b42e05aa9
theuni:
utACK 3b42e05aa9
Tree-SHA512: 73e9da845688a02e5d61770b7cfd5e1a17440182eb524c7329a47df8f1daa6fe0f9cbde5274832bf43f52e17de86473881dc876dee4276c9c06b173b1b78b7a2
2025-02-20 12:08:35 -05:00
..
2025-02-13 18:14:41 +00:00
2025-01-13 21:53:56 +01:00
2024-12-17 10:12:31 +07:00
2025-02-07 09:11:27 +01:00
2025-01-09 15:17:02 +01:00
2025-02-13 12:30:15 -05:00
2025-02-14 11:15:53 +01:00
2025-02-10 08:26:01 -05:00
2025-02-18 12:30:41 +00:00
2025-01-16 11:09:56 +00:00
2024-08-29 13:49:57 +02:00
2024-06-12 14:38:39 +01:00
2025-02-14 11:15:53 +01:00
2025-02-04 11:53:11 -05:00
2024-07-08 11:12:01 +02:00
2025-02-18 16:05:08 +00:00
2025-02-10 08:26:01 -05:00
2025-01-21 13:17:20 -05:00
2024-11-04 14:59:46 -05:00
2024-12-10 21:51:48 +01:00
2025-02-14 14:48:01 -08:00
2024-12-20 15:01:44 +01:00
2025-02-18 12:29:18 +00:00
2025-02-18 18:39:00 -08:00
2024-10-25 18:09:36 +01:00
2024-09-14 20:33:32 +03:00
2024-10-28 12:36:19 +00:00
2024-07-30 14:06:58 -04:00
2024-07-30 14:06:58 -04:00
2024-09-20 12:55:22 -04:00
2024-11-11 12:47:53 -03:00
2024-11-11 12:47:53 -03:00
2025-01-09 10:11:46 -05:00
2025-01-03 09:19:53 -05:00
2025-01-14 19:21:37 +01:00
2024-12-19 13:46:31 +01:00
2024-10-19 18:49:53 +02:00
2024-10-19 18:49:53 +02:00
2025-01-20 21:19:39 +01:00
2024-10-28 12:36:19 +00:00
2025-02-13 12:30:15 -05:00
2024-10-28 12:36:19 +00:00
2025-01-15 12:15:40 +01:00
2024-10-28 12:36:19 +00:00
2025-01-15 12:15:40 +01:00
2024-10-28 12:36:19 +00:00
2025-01-15 12:15:40 +01:00
2024-10-28 12:36:19 +00:00
2025-01-16 21:06:21 +00:00
2024-08-29 13:49:57 +02:00
2024-07-08 11:12:01 +02:00
2024-09-17 09:54:18 +02:00
2025-02-13 12:30:15 -05:00
2024-11-14 13:41:02 -05:00
2024-11-14 13:41:02 -05:00
2024-08-27 07:00:27 +02:00
2024-12-03 18:02:37 -05:00
2025-01-14 19:21:37 +01:00
2024-10-28 12:35:49 +00:00
2024-11-11 14:14:39 +00:00
2025-02-20 12:08:35 -05:00
2024-12-04 14:09:05 -05:00
2024-12-02 13:52:34 +01:00
2024-11-26 20:47:08 -05:00
2024-12-05 14:37:47 +00:00
2024-07-04 22:35:29 +02:00
2024-11-30 20:19:08 +01:00
2024-11-30 20:19:08 +01:00
2024-08-13 07:44:31 +02:00
2024-08-29 13:49:57 +02:00
2024-07-24 09:39:35 +02:00
2024-11-04 14:59:46 -05:00
2024-08-29 13:49:57 +02:00
2024-07-08 11:12:01 +02:00
2025-02-13 12:30:15 -05:00
2025-02-13 12:30:15 -05:00
2024-11-04 17:08:21 +01:00
2024-06-26 15:28:26 -04:00
2024-06-12 16:19:50 -03:00
2025-02-13 12:30:15 -05:00
2025-01-16 21:06:21 +00:00
2024-10-27 15:38:54 +01:00
2024-08-04 08:52:22 +02:00
2024-08-04 08:51:36 +02:00
2024-10-01 11:31:39 +02:00
2024-10-01 11:31:39 +02:00
2024-11-04 14:19:40 -05:00
2024-10-29 11:58:51 -04:00
2024-11-04 18:46:40 +01:00
2024-07-08 11:12:01 +02:00
2025-02-04 10:25:22 +01:00
2024-10-01 21:55:18 -04:00
2024-07-08 11:12:01 +02:00
2025-02-14 15:10:09 -08:00
2025-02-13 12:38:55 +01:00
2025-01-13 21:53:56 +01:00
2025-01-13 21:53:56 +01:00
2024-10-10 12:22:12 +02:00
2024-09-10 11:20:40 -03:00
2025-01-22 11:29:05 +01:00
2025-01-22 11:29:05 +01:00
2024-09-11 17:41:26 +02:00
2024-10-26 23:44:15 +02:00
2024-10-26 23:44:15 +02:00
2024-07-11 19:08:46 +01:00
2024-12-16 10:39:28 +01:00
2024-08-28 19:09:51 +02:00
2025-02-19 10:28:13 -05:00
2025-01-14 19:01:53 +01:00
2024-10-21 23:24:17 +02:00
2025-01-22 15:01:23 -05:00
2024-12-19 14:41:21 +01:00
2024-08-29 13:49:57 +02:00
2024-12-19 13:46:52 +01:00
2024-11-04 18:46:40 +01:00
2024-12-19 14:39:55 +01:00
2024-07-08 11:12:01 +02:00
2024-07-08 11:12:01 +02:00
2025-01-15 12:16:08 +01:00
2025-02-13 12:30:15 -05:00
2024-11-14 13:41:02 -05:00
2024-09-18 20:03:47 +02:00
2025-01-15 15:44:55 +01:00
2024-12-31 00:04:20 -03:00
2024-12-31 00:04:20 -03:00
2025-02-07 13:55:57 -05:00
2025-02-07 13:55:57 -05:00
2025-01-29 18:05:16 -05:00
2025-01-29 18:05:16 -05:00
2024-07-24 09:15:34 +02:00
2025-01-03 09:19:53 -05:00
2025-02-14 13:59:34 -08:00
2025-01-16 15:04:58 +00:00
2024-10-08 15:25:47 +00:00
2024-07-25 11:01:22 +01:00
2024-07-08 11:12:01 +02:00