summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2020-12-15 21:15:05 -0800
committerGravatar GitHub2020-12-15 21:15:05 -0800
commitac3b4f918f4e6d345e9588f02f80b1b0c968f6f9 (patch)
tree7e5bf335ea2ada5d49cfdcd9adc70eccb1b918f2
parentMerge pull request #5190 from Morph1984/validate_device_handle (diff)
parentcmake/conan: Conditionally add target Boost::context (diff)
downloadyuzu-ac3b4f918f4e6d345e9588f02f80b1b0c968f6f9.tar.gz
yuzu-ac3b4f918f4e6d345e9588f02f80b1b0c968f6f9.tar.xz
yuzu-ac3b4f918f4e6d345e9588f02f80b1b0c968f6f9.zip
Merge pull request #5196 from lat9nq/fix-conan-boost-2
cmake/conan: Conditionally add target Boost::context
-rw-r--r--CMakeLists.txt23
1 files changed, 17 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2366d372c..66bbd985a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,13 +194,18 @@ macro(yuzu_find_packages)
194 unset(FN_FORCE_REQUIRED) 194 unset(FN_FORCE_REQUIRED)
195endmacro() 195endmacro()
196 196
197if (NOT Boost_FOUND) 197find_package(Boost 1.73.0 COMPONENTS context headers QUIET)
198 find_package(Boost 1.73.0 COMPONENTS context headers QUIET) 198if (Boost_FOUND)
199 if (Boost_FOUND) 199 set(Boost_LIBRARIES Boost::boost)
200 set(Boost_LIBRARIES Boost::boost Boost::context) 200 # Conditionally add Boost::context only if the active version of the Conan or system Boost package provides it
201 # The old version is missing Boost::context, so we want to avoid adding in that case
202 # The new version requires adding Boost::context to prevent linking issues
203 #
204 # This one is used by Conan on subsequent CMake configures, not the first configure.
205 if (TARGET Boost::context)
206 list(APPEND Boost_LIBRARIES Boost::context)
201 endif() 207 endif()
202endif() 208else()
203if (NOT Boost_FOUND)
204 message(STATUS "Boost 1.73.0 or newer not found, falling back to Conan") 209 message(STATUS "Boost 1.73.0 or newer not found, falling back to Conan")
205 list(APPEND CONAN_REQUIRED_LIBS "boost/1.73.0") 210 list(APPEND CONAN_REQUIRED_LIBS "boost/1.73.0")
206endif() 211endif()
@@ -312,6 +317,12 @@ if (CONAN_REQUIRED_LIBS)
312 if (NOT Boost_FOUND) 317 if (NOT Boost_FOUND)
313 find_package(Boost 1.73.0 REQUIRED COMPONENTS context headers) 318 find_package(Boost 1.73.0 REQUIRED COMPONENTS context headers)
314 set(Boost_LIBRARIES Boost::boost) 319 set(Boost_LIBRARIES Boost::boost)
320 # Conditionally add Boost::context only if the active version of the Conan Boost package provides it
321 # The old version is missing Boost::context, so we want to avoid adding in that case
322 # The new version requires adding Boost::context to prevent linking issues
323 if (TARGET Boost::context)
324 list(APPEND Boost_LIBRARIES Boost::context)
325 endif()
315 endif() 326 endif()
316 327
317 # Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function 328 # Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function