Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#31884: cmake: Make implicit
libbitcoinkernel
dependen…
…cies explicit 3b42e05 cmake: Make implicit `libbitcoinkernel` dependencies explicit (Hennadii Stepanov) 3fd64ef cmake: Avoid using `OBJECT` libraries (Hennadii Stepanov) Pull request description: This PR fixes two regressions introduced in bitcoin#30911. For example, on the master branch @ 28dec6c: - 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 3b42e05 theuni: utACK 3b42e05 Tree-SHA512: 73e9da845688a02e5d61770b7cfd5e1a17440182eb524c7329a47df8f1daa6fe0f9cbde5274832bf43f52e17de86473881dc876dee4276c9c06b173b1b78b7a2
- Loading branch information