summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorlat9nq <22451773+lat9nq@users.noreply.github.com>2020-12-15 00:06:24 +0100
committerlat9nq <22451773+lat9nq@users.noreply.github.com>2020-12-16 05:47:29 +0100
commit9b023a56a3dd42c96a95e1d56698d68e286d9abd (patch)
tree916ed568f5d7bbb1a14f4533fa790ef378243673 /CMakeLists.txt
parentMerge pull request #5193 from lat9nq/fix-conan-boost (diff)
downloadyuzu-9b023a56a3dd42c96a95e1d56698d68e286d9abd.tar
yuzu-9b023a56a3dd42c96a95e1d56698d68e286d9abd.tar.gz
yuzu-9b023a56a3dd42c96a95e1d56698d68e286d9abd.tar.bz2
yuzu-9b023a56a3dd42c96a95e1d56698d68e286d9abd.tar.lz
yuzu-9b023a56a3dd42c96a95e1d56698d68e286d9abd.tar.xz
yuzu-9b023a56a3dd42c96a95e1d56698d68e286d9abd.tar.zst
yuzu-9b023a56a3dd42c96a95e1d56698d68e286d9abd.zip
Diffstat (limited to 'CMakeLists.txt')
-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)
unset(FN_FORCE_REQUIRED)
endmacro()
-if (NOT Boost_FOUND)
- find_package(Boost 1.73.0 COMPONENTS context headers QUIET)
- if (Boost_FOUND)
- set(Boost_LIBRARIES Boost::boost Boost::context)
+find_package(Boost 1.73.0 COMPONENTS context headers QUIET)
+if (Boost_FOUND)
+ set(Boost_LIBRARIES Boost::boost)
+ # Conditionally add Boost::context only if the active version of the Conan or system Boost package provides it
+ # The old version is missing Boost::context, so we want to avoid adding in that case
+ # The new version requires adding Boost::context to prevent linking issues
+ #
+ # This one is used by Conan on subsequent CMake configures, not the first configure.
+ if (TARGET Boost::context)
+ list(APPEND Boost_LIBRARIES Boost::context)
endif()
-endif()
-if (NOT Boost_FOUND)
+else()
message(STATUS "Boost 1.73.0 or newer not found, falling back to Conan")
list(APPEND CONAN_REQUIRED_LIBS "boost/1.73.0")
endif()
@@ -312,6 +317,12 @@ if (CONAN_REQUIRED_LIBS)
if (NOT Boost_FOUND)
find_package(Boost 1.73.0 REQUIRED COMPONENTS context headers)
set(Boost_LIBRARIES Boost::boost)
+ # Conditionally add Boost::context only if the active version of the Conan Boost package provides it
+ # The old version is missing Boost::context, so we want to avoid adding in that case
+ # The new version requires adding Boost::context to prevent linking issues
+ if (TARGET Boost::context)
+ list(APPEND Boost_LIBRARIES Boost::context)
+ endif()
endif()
# Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function