cmake: only link Boost Chrono where needed
What changed, and why it matters
This commit is a routine build-system cleanup. It removes the Boost Chrono library from the link lists of components that don't actually use it, and adds it to the one component that does. There is no change to program logic, no bug fix, and no security relevance visible in the diff.
No security action needed. Treat as normal build hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change is confined to CMakeLists.txt files. It refactors dependency linking so that ${Boost_CHRONO_LIBRARY} is only linked by targets that need it (cryptonote_basic and tests/core_tests) and removed from targets where it was unused. No source code, interfaces, or behavior is altered.
Changed components
CMake build configurationInspect captured patch +2 / −16
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 0046823..d0ce12e 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -73,7 +73,6 @@ target_link_libraries(common
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_REGEX_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
PRIVATE
${OPENSSL_LIBRARIES}
${EXTRA_LIBRARIES})
diff --git a/src/cryptonote_basic/CMakeLists.txt b/src/cryptonote_basic/CMakeLists.txt
index 5b4a84b..0b6bf97 100644
--- a/src/cryptonote_basic/CMakeLists.txt
+++ b/src/cryptonote_basic/CMakeLists.txt
@@ -72,6 +72,7 @@ target_link_libraries(cryptonote_basic
cryptonote_format_utils_basic
device
ringct_basic
+ ${Boost_CHRONO_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index 06230ae..a7eff17 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -59,7 +59,6 @@ target_link_libraries(daemon
daemon_rpc_server
${EPEE_READLINE}
version
- ${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_REGEX_LIBRARY}
diff --git a/src/gen_multisig/CMakeLists.txt b/src/gen_multisig/CMakeLists.txt
index 455dc7d..cde3ddd 100644
--- a/src/gen_multisig/CMakeLists.txt
+++ b/src/gen_multisig/CMakeLists.txt
@@ -39,7 +39,6 @@ target_link_libraries(gen_multisig
common
epee
${EPEE_READLINE}
- ${Boost_CHRONO_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt
index 8685747..23adb6b 100644
--- a/src/rpc/CMakeLists.txt
+++ b/src/rpc/CMakeLists.txt
@@ -167,7 +167,6 @@ target_link_libraries(daemon_rpc_server
version
daemon_messages
serialization
- ${Boost_CHRONO_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
diff --git a/src/serialization/CMakeLists.txt b/src/serialization/CMakeLists.txt
index 9bbba6a..9ac8b1e 100644
--- a/src/serialization/CMakeLists.txt
+++ b/src/serialization/CMakeLists.txt
@@ -45,7 +45,6 @@ target_link_libraries(serialization
cryptonote_core
cryptonote_protocol
epee
- ${Boost_CHRONO_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt
index b976c02..5a7d5f8 100644
--- a/src/wallet/CMakeLists.txt
+++ b/src/wallet/CMakeLists.txt
@@ -56,7 +56,6 @@ target_link_libraries(wallet
device_trezor
net
${LMDB_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
@@ -91,7 +90,6 @@ if(NOT IOS)
version
daemonizer
${EPEE_READLINE}
- ${Boost_CHRONO_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
diff --git a/src/wallet/api/CMakeLists.txt b/src/wallet/api/CMakeLists.txt
index 3428de2..06d8db9 100644
--- a/src/wallet/api/CMakeLists.txt
+++ b/src/wallet/api/CMakeLists.txt
@@ -70,7 +70,6 @@ target_link_libraries(wallet_api
cryptonote_core
mnemonics
${LMDB_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
${Boost_LOCALE_LIBRARY}
${ICU_LIBRARIES}
${Boost_SERIALIZATION_LIBRARY}
diff --git a/tests/core_tests/CMakeLists.txt b/tests/core_tests/CMakeLists.txt
index 4e94992..7042b4c 100644
--- a/tests/core_tests/CMakeLists.txt
+++ b/tests/core_tests/CMakeLists.txt
@@ -82,6 +82,7 @@ target_link_libraries(core_tests
epee
device
wallet
+ ${Boost_CHRONO_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES})
enable_stack_trace(core_tests)
diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt
index 938413a..3b8ae9e 100644
--- a/tests/fuzz/CMakeLists.txt
+++ b/tests/fuzz/CMakeLists.txt
@@ -228,7 +228,6 @@ target_link_libraries(http-client_fuzz_tests
PRIVATE
epee
${Boost_THREAD_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
@@ -245,7 +244,6 @@ target_link_libraries(levin_fuzz_tests
common
epee
${Boost_THREAD_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
@@ -261,7 +259,6 @@ target_link_libraries(bulletproof_fuzz_tests
common
epee
${Boost_THREAD_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
@@ -278,7 +275,6 @@ target_link_libraries(tx-extra_fuzz_tests
common
epee
${Boost_THREAD_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
@@ -295,7 +291,6 @@ target_link_libraries(utf8_fuzz_tests
common
epee
${Boost_THREAD_LIBRARY}
- ${Boost_CHRONO_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES}
$ENV{LIB_FUZZING_ENGINE})
diff --git a/tests/net_load_tests/CMakeLists.txt b/tests/net_load_tests/CMakeLists.txt
index 5f7a2bd..7b39927 100644
--- a/tests/net_load_tests/CMakeLists.txt
+++ b/tests/net_load_tests/CMakeLists.txt
@@ -41,7 +41,6 @@ target_link_libraries(net_load_tests_clt
cryptonote_core
epee
${GTEST_LIBRARIES}
- ${Boost_CHRONO_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBARRY}
@@ -63,7 +62,6 @@ target_link_libraries(net_load_tests_srv
cryptonote_core
epee
${GTEST_LIBRARIES}
- ${Boost_CHRONO_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
diff --git a/tests/trezor/CMakeLists.txt b/tests/trezor/CMakeLists.txt
index 15def47..f40a916 100644
--- a/tests/trezor/CMakeLists.txt
+++ b/tests/trezor/CMakeLists.txt
@@ -58,7 +58,6 @@ target_link_libraries(trezor_tests
rpc
cryptonote_protocol
daemon_rpc_server
- ${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.