summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Bouvier2022-12-06 21:01:26 +0100
committerGravatar Alexandre Bouvier2023-02-28 17:56:01 +0100
commit57fd8b1f451f95495167581066e3fcf981f7c054 (patch)
treebb78cab1cf1221fbc991aa8018c1d3de8f9ea489
parentMerge pull request #9851 from abouvier/openssl-vcpkg (diff)
downloadyuzu-57fd8b1f451f95495167581066e3fcf981f7c054.tar.gz
yuzu-57fd8b1f451f95495167581066e3fcf981f7c054.tar.xz
yuzu-57fd8b1f451f95495167581066e3fcf981f7c054.zip
cmake: use correct boost imported targets
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt28
-rw-r--r--src/common/CMakeLists.txt2
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/input_common/CMakeLists.txt2
-rw-r--r--src/network/CMakeLists.txt2
-rw-r--r--src/yuzu/CMakeLists.txt2
6 files changed, 7 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0f344ffd9..5f6f86e68 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
213find_package(Boost 1.73.0 REQUIRED context)
213find_package(enet 1.3 MODULE) 214find_package(enet 1.3 MODULE)
214find_package(fmt 9 REQUIRED) 215find_package(fmt 9 REQUIRED)
215find_package(inih MODULE) 216find_package(inih MODULE)
@@ -253,19 +254,6 @@ if (YUZU_TESTS)
253 find_package(Catch2 3.0.1 REQUIRED) 254 find_package(Catch2 3.0.1 REQUIRED)
254endif() 255endif()
255 256
256find_package(Boost 1.73.0 COMPONENTS context)
257if (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()
265else()
266 message(FATAL_ERROR "Boost 1.73.0 or newer not found")
267endif()
268
269# boost:asio has functions that require AcceptEx et al 257# boost:asio has functions that require AcceptEx et al
270if (MINGW) 258if (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()
463endif() 451endif()
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
468if (TARGET Boost::boost)
469 set_target_properties(Boost::boost PROPERTIES IMPORTED_GLOBAL TRUE)
470 add_library(boost ALIAS Boost::boost)
471endif()
472
473# List of all FFmpeg components required 453# List of all FFmpeg components required
474set(FFmpeg_COMPONENTS 454set(FFmpeg_COMPONENTS
475 avcodec 455 avcodec
@@ -585,11 +565,7 @@ function(create_target_directory_groups target_name)
585endfunction() 565endfunction()
586 566
587# Prevent boost from linking against libs when building 567# Prevent boost from linking against libs when building
588add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY 568target_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
594if (MSVC AND CMAKE_GENERATOR STREQUAL "Ninja") 570if (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
177create_target_directory_groups(common) 177create_target_directory_groups(common)
178 178
179target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) 179target_link_libraries(common PUBLIC Boost::context Boost::headers fmt::fmt microprofile Threads::Threads)
180target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle) 180target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
181 181
182if (YUZU_USE_PRECOMPILED_HEADERS) 182if (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()
832create_target_directory_groups(core) 832create_target_directory_groups(core)
833 833
834target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core) 834target_link_libraries(core PUBLIC common PRIVATE audio_core network video_core)
835target_link_libraries(core PUBLIC Boost::boost PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus) 835target_link_libraries(core PUBLIC Boost::headers PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls Opus::opus)
836if (MINGW) 836if (MINGW)
837 target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY}) 837 target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
838endif() 838endif()
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)
89endif() 89endif()
90 90
91create_target_directory_groups(input_common) 91create_target_directory_groups(input_common)
92target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost) 92target_link_libraries(input_common PUBLIC core PRIVATE common Boost::headers)
93 93
94if (YUZU_USE_PRECOMPILED_HEADERS) 94if (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
20create_target_directory_groups(network) 20create_target_directory_groups(network)
21 21
22target_link_libraries(network PRIVATE common enet::enet Boost::boost) 22target_link_libraries(network PRIVATE common enet::enet Boost::headers)
23if (ENABLE_WEB_SERVICE) 23if (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()
314create_target_directory_groups(yuzu) 314create_target_directory_groups(yuzu)
315 315
316target_link_libraries(yuzu PRIVATE common core input_common network video_core) 316target_link_libraries(yuzu PRIVATE common core input_common network video_core)
317target_link_libraries(yuzu PRIVATE Boost::boost glad Qt${QT_MAJOR_VERSION}::Widgets) 317target_link_libraries(yuzu PRIVATE Boost::headers glad Qt${QT_MAJOR_VERSION}::Widgets)
318target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) 318target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
319 319
320target_link_libraries(yuzu PRIVATE Vulkan::Headers) 320target_link_libraries(yuzu PRIVATE Vulkan::Headers)