summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 30 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 273260378..66bbd985a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,9 @@ if (NOT DEFINED ARCHITECTURE)
endif()
message(STATUS "Target architecture: ${ARCHITECTURE}")
+if (UNIX)
+ add_definitions(-DYUZU_UNIX=1)
+endif()
# Configure C++ standard
# ===========================
@@ -157,7 +160,6 @@ macro(yuzu_find_packages)
# Capitalization matters here. We need the naming to match the generated paths from Conan
set(REQUIRED_LIBS
# Cmake Pkg Prefix Version Conan Pkg
- "Boost 1.73 boost/1.73.0"
"Catch2 2.13 catch2/2.13.0"
"fmt 7.1 fmt/7.1.2"
# can't use until https://github.com/bincrafters/community/issues/1173
@@ -192,6 +194,22 @@ macro(yuzu_find_packages)
unset(FN_FORCE_REQUIRED)
endmacro()
+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()
+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()
+
# Attempt to locate any packages that are required and report the missing ones in CONAN_REQUIRED_LIBS
yuzu_find_packages()
@@ -296,6 +314,17 @@ if (CONAN_REQUIRED_LIBS)
# this time with required, so we bail if its not found.
yuzu_find_packages(FORCE_REQUIRED)
+ 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
if(ENABLE_QT)
list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")