From 964df7ef38196ed8f840c2b2c7d054c34cab029e Mon Sep 17 00:00:00 2001 From: collecting Date: Wed, 1 Oct 2025 16:51:05 +0000 Subject: [PATCH] fix: boost_process Linux issue --- src/core/CMakeLists.txt | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 9533471e8..d3e0cb104 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1220,12 +1220,29 @@ else() ) endif() -target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz) -if(ANDROID) - target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API) -else() - target_link_libraries(core PUBLIC Boost::headers Boost::process PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API) +# Link against all the libraries that are always required. +target_link_libraries(core + PUBLIC + common + Boost::headers + PRIVATE + audio_core + hid_core + network + video_core + nx_tzdb + tz + fmt::fmt + nlohmann_json::nlohmann_json + mbedtls + RenderDoc::API +) + +# Conditionally link against Boost::process ONLY if it was found by the main CMakeLists.txt. +if(Boost_PROCESS_FOUND) + target_link_libraries(core PUBLIC Boost::process) endif() + if (MINGW) target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY}) endif()