mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-08 10:47:56 +00:00
fix: Linux compilation
There were linking errors Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
This commit is contained in:
@@ -7,10 +7,33 @@ add_executable(citron-room
|
||||
citron_room.rc
|
||||
)
|
||||
|
||||
target_link_libraries(citron-room PRIVATE common network)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citron-room PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(citron-room PRIVATE web_service)
|
||||
# Robust static linking order using GNU ld group to resolve cycles
|
||||
if (NOT MSVC)
|
||||
# Use GNU ld.bfd for GCC LTO archives (ld.lld cannot consume GCC LTO plugin objects)
|
||||
target_link_options(citron-room PRIVATE -fuse-ld=bfd)
|
||||
|
||||
# Robust static linking under LTO: force-include these archives and allow cyclic resolution
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citron-room PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(citron-room PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"-Wl,--whole-archive" common network core web_service "-Wl,--no-whole-archive"
|
||||
"-Wl,--end-group"
|
||||
)
|
||||
else()
|
||||
target_link_libraries(citron-room PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"-Wl,--whole-archive" common network core "-Wl,--no-whole-archive"
|
||||
"-Wl,--end-group"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
# Fallback for MSVC (no --start-group/--end-group)
|
||||
target_link_libraries(citron-room PRIVATE common network core)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citron-room PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(citron-room PRIVATE web_service)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(citron-room PRIVATE mbedtls mbedcrypto)
|
||||
|
||||
Reference in New Issue
Block a user