diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a7faa1c4..f26a0c6b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -210,6 +210,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) | |||
| 210 | # ======================================================================= | 210 | # ======================================================================= |
| 211 | 211 | ||
| 212 | # Enforce the search mode of non-required packages for better and shorter failure messages | 212 | # Enforce the search mode of non-required packages for better and shorter failure messages |
| 213 | find_package(Boost 1.73.0 REQUIRED context) | ||
| 213 | find_package(enet 1.3 MODULE) | 214 | find_package(enet 1.3 MODULE) |
| 214 | find_package(fmt 9 REQUIRED) | 215 | find_package(fmt 9 REQUIRED) |
| 215 | find_package(inih 52 MODULE COMPONENTS INIReader) | 216 | find_package(inih 52 MODULE COMPONENTS INIReader) |
| @@ -253,19 +254,6 @@ if (YUZU_TESTS) | |||
| 253 | find_package(Catch2 3.0.1 REQUIRED) | 254 | find_package(Catch2 3.0.1 REQUIRED) |
| 254 | endif() | 255 | endif() |
| 255 | 256 | ||
| 256 | find_package(Boost 1.73.0 COMPONENTS context) | ||
| 257 | if (Boost_FOUND) | ||
| 258 | set(Boost_LIBRARIES Boost::boost) | ||
| 259 | # Conditionally add Boost::context only if the found Boost package provides it | ||
| 260 | # The old version is missing Boost::context, so we want to avoid adding in that case | ||
| 261 | # The new version requires adding Boost::context to prevent linking issues | ||
| 262 | if (TARGET Boost::context) | ||
| 263 | list(APPEND Boost_LIBRARIES Boost::context) | ||
| 264 | endif() | ||
| 265 | else() | ||
| 266 | message(FATAL_ERROR "Boost 1.73.0 or newer not found") | ||
| 267 | endif() | ||
| 268 | |||
| 269 | # boost:asio has functions that require AcceptEx et al | 257 | # boost:asio has functions that require AcceptEx et al |
| 270 | if (MINGW) | 258 | if (MINGW) |
| 271 | find_library(MSWSOCK_LIBRARY mswsock REQUIRED) | 259 | find_library(MSWSOCK_LIBRARY mswsock REQUIRED) |
| @@ -462,14 +450,6 @@ if (ENABLE_SDL2) | |||
| 462 | endif() | 450 | endif() |
| 463 | endif() | 451 | endif() |
| 464 | 452 | ||
| 465 | # Reexport some targets that are named differently when using the upstream CmakeConfig | ||
| 466 | # In order to ALIAS targets to a new name, they first need to be IMPORTED_GLOBAL | ||
| 467 | # Dynarmic checks for target `boost` and so we want to make sure it can find it through our system instead of using their external | ||
| 468 | if (TARGET Boost::boost) | ||
| 469 | set_target_properties(Boost::boost PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| 470 | add_library(boost ALIAS Boost::boost) | ||
| 471 | endif() | ||
| 472 | |||
| 473 | # List of all FFmpeg components required | 453 | # List of all FFmpeg components required |
| 474 | set(FFmpeg_COMPONENTS | 454 | set(FFmpeg_COMPONENTS |
| 475 | avcodec | 455 | avcodec |
| @@ -585,11 +565,7 @@ function(create_target_directory_groups target_name) | |||
| 585 | endfunction() | 565 | endfunction() |
| 586 | 566 | ||
| 587 | # Prevent boost from linking against libs when building | 567 | # Prevent boost from linking against libs when building |
| 588 | add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY | 568 | target_link_libraries(Boost::headers INTERFACE Boost::disable_autolinking) |
| 589 | -DBOOST_SYSTEM_NO_LIB | ||
| 590 | -DBOOST_DATE_TIME_NO_LIB | ||
| 591 | -DBOOST_REGEX_NO_LIB | ||
| 592 | ) | ||
| 593 | # Adjustments for MSVC + Ninja | 569 | # Adjustments for MSVC + Ninja |
| 594 | if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja") | 570 | if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja") |
| 595 | add_compile_options( | 571 | add_compile_options( |