From 03f7550a095954e6633a64c3025c98d3b3d06926 Mon Sep 17 00:00:00 2001 From: Dan Notestein Date: Wed, 7 Jan 2026 20:29:13 -0500 Subject: [PATCH] Fix: Don't override parent's BOOST_COMPONENTS when used as submodule When FC is used as a submodule in hive, the parent project defines BOOST_COMPONENTS with all needed components (including program_options). The previous code unconditionally cleared and reset BOOST_COMPONENTS, which caused link failures due to missing boost::program_options. Now FC only sets its own BOOST_COMPONENTS when building standalone (when no parent has defined it). --- CMakeLists.txt | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92e6273..b23fdf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -483,27 +483,29 @@ TARGET_LINK_OPTIONS( CommonBuildOptions INTERFACE $<$:${HIVE_ASAN_L TARGET_LINK_LIBRARIES( fc_core PUBLIC CommonBuildOptions ) -# Define Boost components needed by FC -SET( BOOST_COMPONENTS ) -if(HIVE_BUILD_ON_MINIMAL_FC) - # Minimal build (used for WASM/Emscripten) needs fewer components - LIST( APPEND BOOST_COMPONENTS - chrono - date_time - filesystem - system ) -else() - # Full build needs all components - LIST( APPEND BOOST_COMPONENTS - chrono - context - coroutine - date_time - filesystem - iostreams - system - thread - unit_test_framework ) +# Define Boost components needed by FC (only when building standalone) +# When used as a submodule, the parent project defines BOOST_COMPONENTS +if(NOT BOOST_COMPONENTS) + if(HIVE_BUILD_ON_MINIMAL_FC) + # Minimal build (used for WASM/Emscripten) needs fewer components + LIST( APPEND BOOST_COMPONENTS + chrono + date_time + filesystem + system ) + else() + # Full build needs all components + LIST( APPEND BOOST_COMPONENTS + chrono + context + coroutine + date_time + filesystem + iostreams + system + thread + unit_test_framework ) + endif() endif() ADD_LIBRARY( STATIC_BOOST INTERFACE ) -- GitLab