diff --git a/CMakeLists.txt b/CMakeLists.txt index f3ceb73f2..b2d0276c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -205,6 +205,12 @@ find_package(Boost 1.81 REQUIRED COMPONENTS json url coroutine) message(STATUS "LaunchDarkly: using Boost v${Boost_VERSION}") set(FOXY_BUILD_TESTING OFF) + +# Keep Boost.Asio header-only, matching how consumers compile it. Foxy's +# separate-compilation mode bakes Asio internals into our library whose layout can +# diverge from a consumer's build, causing ODR violations when linked. Force off. +set(FOXY_FAST_BUILD OFF CACHE BOOL "Keep Boost.Asio header-only for ABI compatibility with consumers" FORCE) + add_subdirectory(vendor/foxy) diff --git a/libs/networking/src/CMakeLists.txt b/libs/networking/src/CMakeLists.txt index bf229726d..a3aa8f24a 100644 --- a/libs/networking/src/CMakeLists.txt +++ b/libs/networking/src/CMakeLists.txt @@ -35,8 +35,6 @@ target_compile_features(${LIBNAME} PUBLIC cxx_std_17) target_compile_definitions(${LIBNAME} PUBLIC LD_CURL_NETWORKING - BOOST_ASIO_SEPARATE_COMPILATION=1 - BOOST_BEAST_SEPARATE_COMPILATION=1 ) # Using PUBLIC_HEADERS would flatten the include.