[cmake] fix apple, android builds #2619

Merged
crueter merged 4 commits from fix-appldfl into master 2025-09-30 02:18:32 +02:00
2 changed files with 36 additions and 13 deletions

View file

@ -210,7 +210,7 @@ endif()
option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" ON) option(YUZU_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" ON)
CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF) CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "LINUX" OFF)
CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF) CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF)
@ -894,24 +894,47 @@ if (MSVC AND CXX_CLANG)
link_libraries(llvm-mingw-runtime) link_libraries(llvm-mingw-runtime)
endif() endif()
#[[
search order:
- gold (GCC only) - the best, generally, but unfortunately not packaged anymore
- mold (GCC only) - generally does well on GCC
- ldd - preferred on clang
- bfd - the final fallback
- If none are found (macOS uses ld.prime, etc) just use the default linker
]]
if (YUZU_USE_FASTER_LD) if (YUZU_USE_FASTER_LD)
# fallback if everything fails (bfd) find_program(LINKER_BFD bfd)
set(LINKER bfd) if (LINKER_BFD)
# clang should always use lld set(LINKER bfd)
find_program(LLD lld) endif()
if (LLD)
find_program(LINKER_LLD lld)
if (LINKER_LLD)
set(LINKER lld) set(LINKER lld)
endif() endif()
# GNU appears to work better with mold
# TODO: mold has been slow lately, see if better options exist (search for gold?)
if (CXX_GCC) if (CXX_GCC)
find_program(MOLD mold) find_program(LINKER_MOLD mold)
if (MOLD AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1") if (LINKER_MOLD AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1")
set(LINKER mold) set(LINKER mold)
endif() endif()
find_program(LINKER_GOLD gold)
if (LINKER_GOLD)
set(LINKER gold)
endif()
endif()
if (LINKER)
message(NOTICE "Selecting ${LINKER} as linker")
add_link_options("-fuse-ld=${LINKER}")
else()
message(WARNING "No faster linker found--using default")
endif()
if (LINKER STREQUAL "lld" AND CXX_GCC)
message(WARNING "Using lld on GCC may cause issues with certain LTO settings. If the program fails to compile, disable YUZU_USE_FASTER_LD, or install mold or GNU gold.")
endif() endif()
message(NOTICE "Selecting ${LINKER} as linker")
add_link_options("-fuse-ld=${LINKER}")
endif() endif()
# Set runtime library to MD/MDd for all configurations # Set runtime library to MD/MDd for all configurations

View file

@ -870,7 +870,7 @@
<string name="save_load_error">Save/Load Error</string> <string name="save_load_error">Save/Load Error</string>
<string name="fatal_error">Fatal Error</string> <string name="fatal_error">Fatal Error</string>
<string name="fatal_error_message">A fatal error occurred. Check the log for details.\nContinuing emulation may result in crashes.</string> <string name="fatal_error_message">A fatal error occurred. Check the log for details.\nContinuing emulation may result in crashes.</string>
<string name="performance_warning">Turning off this setting will significantly degrade performance. It's recommended that you leave this setting enabled.</string> <string name="performance_warning">Turning off this setting will significantly degrade performance. It&quot;s recommended that you leave this setting enabled.</string>

Well, probably we will need to change it to \' or everything to &quot;

Well, probably we will need to change it to `\'` or everything to `&quot;`
<string name="device_memory_inadequate">Device RAM: %1$s\nRecommended: %2$s</string> <string name="device_memory_inadequate">Device RAM: %1$s\nRecommended: %2$s</string>
<string name="memory_formatted">%1$s %2$s</string> <string name="memory_formatted">%1$s %2$s</string>
<string name="no_game_present">No bootable game present!</string> <string name="no_game_present">No bootable game present!</string>