diff options
| -rw-r--r-- | CMakeLists.txt | 28 | ||||
| -rw-r--r-- | src/common/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/input_common/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/network/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 2 |
6 files changed, 7 insertions, 31 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( |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 9884a4a0b..56b247ac4 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -176,7 +176,7 @@ endif() | |||
| 176 | 176 | ||
| 177 | create_target_directory_groups(common) | 177 | create_target_directory_groups(common) |
| 178 | 178 | ||
| 179 | target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) | 179 | target_link_libraries(common PUBLIC Boost::context Boost::headers fmt::fmt microprofile Threads::Threads) |
| 180 | target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle) | 180 | target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle) |
| 181 | 181 | ||
| 182 | if (YUZU_USE_PRECOMPILED_HEADERS) | 182 | if (YUZU_USE_PRECOMPILED_HEADERS) |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 70fa1edf5..696a1f9ea 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -832,7 +832,7 @@ endif() | |||
| 832 | create_target_directory_groups(core) | 832 | create_target_directory_groups(core) |
| 833 | 833 | ||
| 834 | target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core) | 834 | target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core) |
| 835 | target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus) | 835 | target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus) |
| 836 | if (MINGW) | 836 | if (MINGW) |
| 837 | target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY}) | 837 | target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY}) |
| 838 | endif() | 838 | endif() |
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt index e3b627e4f..322c29065 100644 --- a/src/input_common/CMakeLists.txt +++ b/src/input_common/CMakeLists.txt | |||
| @@ -89,7 +89,7 @@ if (ENABLE_LIBUSB) | |||
| 89 | endif() | 89 | endif() |
| 90 | 90 | ||
| 91 | create_target_directory_groups(input_common) | 91 | create_target_directory_groups(input_common) |
| 92 | target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost) | 92 | target_link_libraries(input_common PUBLIC core PRIVATE common Boost::headers) |
| 93 | 93 | ||
| 94 | if (YUZU_USE_PRECOMPILED_HEADERS) | 94 | if (YUZU_USE_PRECOMPILED_HEADERS) |
| 95 | target_precompile_headers(input_common PRIVATE precompiled_headers.h) | 95 | target_precompile_headers(input_common PRIVATE precompiled_headers.h) |
diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 1ab52da59..8e306219f 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt | |||
| @@ -19,7 +19,7 @@ add_library(network STATIC | |||
| 19 | 19 | ||
| 20 | create_target_directory_groups(network) | 20 | create_target_directory_groups(network) |
| 21 | 21 | ||
| 22 | target_link_libraries(network PRIVATE common enet::enet Boost::boost) | 22 | target_link_libraries(network PRIVATE common enet::enet Boost::headers) |
| 23 | if (ENABLE_WEB_SERVICE) | 23 | if (ENABLE_WEB_SERVICE) |
| 24 | target_compile_definitions(network PRIVATE -DENABLE_WEB_SERVICE) | 24 | target_compile_definitions(network PRIVATE -DENABLE_WEB_SERVICE) |
| 25 | target_link_libraries(network PRIVATE web_service) | 25 | target_link_libraries(network PRIVATE web_service) |
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 06d982d9b..0f8c1e6a6 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -314,7 +314,7 @@ endif() | |||
| 314 | create_target_directory_groups(yuzu) | 314 | create_target_directory_groups(yuzu) |
| 315 | 315 | ||
| 316 | target_link_libraries(yuzu PRIVATE common core input_common network video_core) | 316 | target_link_libraries(yuzu PRIVATE common core input_common network video_core) |
| 317 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt${QT_MAJOR_VERSION}::Widgets) | 317 | target_link_libraries(yuzu PRIVATE Boost::headers glad Qt${QT_MAJOR_VERSION}::Widgets) |
| 318 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) | 318 | target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) |
| 319 | 319 | ||
| 320 | target_link_libraries(yuzu PRIVATE Vulkan::Headers) | 320 | target_link_libraries(yuzu PRIVATE Vulkan::Headers) |