mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-19 02:33:32 +00:00
fix: Linux compilation
There were linking errors Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# buildcache wrapper
|
||||
OPTION(USE_CCACHE "Use buildcache for compilation" OFF)
|
||||
IF(USE_CCACHE)
|
||||
FIND_PROGRAM(CCACHE buildcache)
|
||||
IF (CCACHE)
|
||||
MESSAGE(STATUS "Using buildcache found in PATH")
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
|
||||
ELSE(CCACHE)
|
||||
MESSAGE(WARNING "USE_CCACHE enabled, but no buildcache executable found")
|
||||
ENDIF(CCACHE)
|
||||
ENDIF(USE_CCACHE)
|
||||
# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# buildcache wrapper
|
||||
OPTION(USE_CCACHE "Use buildcache for compilation" OFF)
|
||||
IF(USE_CCACHE)
|
||||
FIND_PROGRAM(CCACHE buildcache)
|
||||
IF (CCACHE)
|
||||
MESSAGE(STATUS "Using buildcache found in PATH")
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
|
||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
|
||||
ELSE(CCACHE)
|
||||
MESSAGE(WARNING "USE_CCACHE enabled, but no buildcache executable found")
|
||||
ENDIF(CCACHE)
|
||||
ENDIF(USE_CCACHE)
|
||||
|
||||
6
dist/icons/controller/controller.qrc
vendored
6
dist/icons/controller/controller.qrc
vendored
@@ -6,10 +6,10 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
<RCC>
|
||||
<qresource prefix="controller">
|
||||
<file alias="applet_dual_joycon">applet_dual_joycon.png</file>
|
||||
<file alias="applet_dual_joycon_dark">applet_dual_joycon_dark.png</file>
|
||||
<file alias="applet_dual_joycon_midnight">applet_dual_joycon_midnight.png</file>
|
||||
<file alias="applet_dual_joycon_dark">applet_dual_joycon_dark.png</file>
|
||||
<file alias="applet_dual_joycon_midnight">applet_dual_joycon_midnight.png</file>
|
||||
<file alias="applet_handheld">applet_handheld.png</file>
|
||||
<file alias="applet_handheld_dark">applet_handheld_dark.png</file>
|
||||
<file alias="applet_handheld_dark">applet_handheld_dark.png</file>
|
||||
<file alias="applet_handheld_midnight">applet_handheld_midnight.png</file>
|
||||
<file alias="applet_pro_controller">applet_pro_controller.png</file>
|
||||
<file alias="applet_pro_controller_dark">applet_pro_controller_dark.png</file>
|
||||
|
||||
@@ -388,7 +388,30 @@ elseif(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(citron PRIVATE common core input_common frontend_common network video_core)
|
||||
# Robust static linking and linker selection under GCC LTO
|
||||
if (NOT MSVC)
|
||||
# Use GNU ld.bfd for GCC LTO plugin-aware archive resolution
|
||||
target_link_options(citron PRIVATE -fuse-ld=bfd)
|
||||
|
||||
# Force-include critical static archives and resolve cycles
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citron PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(citron PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"-Wl,--whole-archive" common core input_common frontend_common network video_core web_service "-Wl,--no-whole-archive"
|
||||
"-Wl,--end-group"
|
||||
)
|
||||
else()
|
||||
target_link_libraries(citron PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"-Wl,--whole-archive" common core input_common frontend_common network video_core "-Wl,--no-whole-archive"
|
||||
"-Wl,--end-group"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
target_link_libraries(citron PRIVATE common core input_common frontend_common network video_core)
|
||||
endif()
|
||||
|
||||
target_link_libraries(citron PRIVATE Boost::headers glad Qt${QT_MAJOR_VERSION}::Widgets)
|
||||
target_link_libraries(citron PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
||||
|
||||
|
||||
@@ -28,7 +28,30 @@ add_executable(citron-cmd
|
||||
citron.rc
|
||||
)
|
||||
|
||||
target_link_libraries(citron-cmd PRIVATE common core input_common frontend_common)
|
||||
# Robust static linking and linker selection under GCC LTO
|
||||
if (NOT MSVC)
|
||||
# Use GNU ld.bfd for GCC LTO plugin-aware archive resolution
|
||||
target_link_options(citron-cmd PRIVATE -fuse-ld=bfd)
|
||||
|
||||
# Force-include critical static archives and resolve cycles
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(citron-cmd PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_link_libraries(citron-cmd PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"-Wl,--whole-archive" common core input_common frontend_common network web_service "-Wl,--no-whole-archive"
|
||||
"-Wl,--end-group"
|
||||
)
|
||||
else()
|
||||
target_link_libraries(citron-cmd PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"-Wl,--whole-archive" common core input_common frontend_common network "-Wl,--no-whole-archive"
|
||||
"-Wl,--end-group"
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
target_link_libraries(citron-cmd PRIVATE common core input_common frontend_common)
|
||||
endif()
|
||||
|
||||
target_link_libraries(citron-cmd PRIVATE glad)
|
||||
if (MSVC)
|
||||
target_link_libraries(citron-cmd PRIVATE getopt)
|
||||
|
||||
@@ -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