mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-07 10:23:53 +00:00
Fix LTO linking issues on CachyOS with GCC 15.x - Add LTO support to all core library targets (input_common, frontend_common, network, shader_recompiler, web_service) that were missing LTO configuration - Create citron_configure_lto() helper function for consistent LTO handling - Implement CachyOS-specific detection via /etc/os-release and kernel version - Apply conservative LTO flags (-flto=auto -ffat-lto-objects) only for CachyOS + GCC 15+ to resolve linking errors with newer toolchains - Other distributions continue using aggressive LTO settings for maximum performance - Disable LTO on executable targets to prevent main function optimization issues This resolves "undefined symbol" errors when building with -DCITRON_ENABLE_LTO=ON on CachyOS while maintaining optimal LTO performance on other distributions. Fixes linking errors including: - Core::Frontend::EmuWindow symbols - Core::System methods - Settings::values - Common logging functions Tested on CachyOS with GCC 15.1.1 + LLD 20.1.8 Signed-off-by: Boss.sfc <boss.sfc@citron-emu.org>
27 lines
713 B
CMake
27 lines
713 B
CMake
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
add_library(web_service STATIC
|
|
announce_room_json.cpp
|
|
announce_room_json.h
|
|
precompiled_headers.h
|
|
telemetry_json.cpp
|
|
telemetry_json.h
|
|
verify_login.cpp
|
|
verify_login.h
|
|
verify_user_jwt.cpp
|
|
verify_user_jwt.h
|
|
web_backend.cpp
|
|
web_backend.h
|
|
web_result.h
|
|
)
|
|
|
|
create_target_directory_groups(web_service)
|
|
target_link_libraries(web_service PRIVATE common network nlohmann_json::nlohmann_json httplib::httplib cpp-jwt::cpp-jwt)
|
|
|
|
if (CITRON_USE_PRECOMPILED_HEADERS)
|
|
target_precompile_headers(web_service PRIVATE precompiled_headers.h)
|
|
endif()
|
|
|
|
citron_configure_lto(web_service)
|