diff options
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cd59e7485..16f31b3a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -51,6 +51,8 @@ option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}") | |||
| 51 | 51 | ||
| 52 | option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON) | 52 | option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON) |
| 53 | 53 | ||
| 54 | CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF) | ||
| 55 | |||
| 54 | if (YUZU_USE_BUNDLED_VCPKG) | 56 | if (YUZU_USE_BUNDLED_VCPKG) |
| 55 | if (YUZU_TESTS) | 57 | if (YUZU_TESTS) |
| 56 | list(APPEND VCPKG_MANIFEST_FEATURES "yuzu-tests") | 58 | list(APPEND VCPKG_MANIFEST_FEATURES "yuzu-tests") |
| @@ -579,6 +581,21 @@ if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja") | |||
| 579 | ) | 581 | ) |
| 580 | endif() | 582 | endif() |
| 581 | 583 | ||
| 584 | if (YUZU_USE_FASTER_LD AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
| 585 | # We will assume that if the compiler is GCC, it will attempt to use ld.bfd by default. | ||
| 586 | # Try to pick a faster linker. | ||
| 587 | find_program(LLD lld) | ||
| 588 | find_program(MOLD mold) | ||
| 589 | |||
| 590 | if (MOLD AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12.1") | ||
| 591 | message(NOTICE "Selecting mold as linker") | ||
| 592 | add_link_options("-fuse-ld=mold") | ||
| 593 | elseif (LLD) | ||
| 594 | message(NOTICE "Selecting lld as linker") | ||
| 595 | add_link_options("-fuse-ld=lld") | ||
| 596 | endif() | ||
| 597 | endif() | ||
| 598 | |||
| 582 | enable_testing() | 599 | enable_testing() |
| 583 | add_subdirectory(externals) | 600 | add_subdirectory(externals) |
| 584 | add_subdirectory(src) | 601 | add_subdirectory(src) |