2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

Merge pull request #5193 from lat9nq/fix-conan-boost

cmake: Fix generating CMake configs and linking with Boost
This commit is contained in:
bunnei 2020-12-12 23:42:14 -08:00 committed by GitHub
commit c96930fd9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View file

@ -160,7 +160,6 @@ macro(yuzu_find_packages)
# Capitalization matters here. We need the naming to match the generated paths from Conan # Capitalization matters here. We need the naming to match the generated paths from Conan
set(REQUIRED_LIBS set(REQUIRED_LIBS
# Cmake Pkg Prefix Version Conan Pkg # Cmake Pkg Prefix Version Conan Pkg
"Boost 1.73 boost/1.73.0"
"Catch2 2.13 catch2/2.13.0" "Catch2 2.13 catch2/2.13.0"
"fmt 7.1 fmt/7.1.2" "fmt 7.1 fmt/7.1.2"
# can't use until https://github.com/bincrafters/community/issues/1173 # can't use until https://github.com/bincrafters/community/issues/1173
@ -195,6 +194,17 @@ macro(yuzu_find_packages)
unset(FN_FORCE_REQUIRED) unset(FN_FORCE_REQUIRED)
endmacro() 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)
endif()
endif()
if (NOT Boost_FOUND)
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 # Attempt to locate any packages that are required and report the missing ones in CONAN_REQUIRED_LIBS
yuzu_find_packages() yuzu_find_packages()
@ -299,6 +309,11 @@ if (CONAN_REQUIRED_LIBS)
# this time with required, so we bail if its not found. # this time with required, so we bail if its not found.
yuzu_find_packages(FORCE_REQUIRED) yuzu_find_packages(FORCE_REQUIRED)
if (NOT Boost_FOUND)
find_package(Boost 1.73.0 REQUIRED COMPONENTS context headers)
set(Boost_LIBRARIES Boost::boost)
endif()
# Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function # Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function
if(ENABLE_QT) if(ENABLE_QT)
list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}") list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")

View file

@ -210,7 +210,7 @@ endif()
create_target_directory_groups(common) create_target_directory_groups(common)
target_link_libraries(common PUBLIC Boost::boost fmt::fmt microprofile) target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile)
target_link_libraries(common PRIVATE lz4::lz4 xbyak) target_link_libraries(common PRIVATE lz4::lz4 xbyak)
if (MSVC) if (MSVC)
target_link_libraries(common PRIVATE zstd::zstd) target_link_libraries(common PRIVATE zstd::zstd)