[cmake] refactor: CPM over vcpkg #250
9 changed files with 52 additions and 55 deletions
|
@ -442,14 +442,26 @@ if (YUZU_USE_CPM)
|
|||
# TODO(crueter): renderdoc?
|
||||
|
||||
AddPackage(
|
||||
NAME boost
|
||||
NAME Boost
|
||||
URL "https://github.com/boostorg/boost/releases/download/boost-1.88.0/boost-1.88.0-cmake.7z"
|
||||
REPO boostorg/boost
|
||||
SHA "1.88.0"
|
||||
KEY "1880"
|
||||
VERSION 1.57
|
||||
)
|
||||
|
||||
if (boost_ADDED AND WIN32)
|
||||
add_compile_definitions(YUZU_BOOST_v1)
|
||||
set(BOOST_NO_HEADERS ${Boost_ADDED})
|
||||
|
||||
if (Boost_ADDED)
|
||||
if (MSVC)
|
||||
add_compile_definitions(YUZU_BOOST_v1)
|
||||
else()
|
||||
message(WARNING "Using bundled Boost on a non-MSVC system is not recommended. You are strongly encouraged to install Boost through your system's package manager.")
|
||||
# boost sucks
|
||||
target_compile_options(boost_heap INTERFACE -Wno-shadow)
|
||||
target_compile_options(boost_icl INTERFACE -Wno-shadow)
|
||||
target_compile_options(boost_asio INTERFACE -Wno-conversion)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
AddPackage(
|
||||
|
@ -465,7 +477,6 @@ if (YUZU_USE_CPM)
|
|||
REPO lz4/lz4
|
||||
SHA ebb370ca83
|
||||
HASH 43600e87b35256005c0f2498fa56a77de6783937ba4cfce38c099f27c03188d097863e8a50c5779ca0a7c63c29c4f7ed0ae526ec798c1fd2e3736861b62e0a37
|
||||
SYSTEM_PACKAGE ON
|
||||
)
|
||||
|
||||
if (lz4_ADDED)
|
||||
|
@ -619,6 +630,12 @@ endfunction()
|
|||
|
||||
add_subdirectory(externals)
|
||||
|
||||
# pass targets from externals
|
||||
find_package(VulkanHeaders REQUIRED)
|
||||
find_package(VulkanUtilityLibraries REQUIRED)
|
||||
find_package(VulkanMemoryAllocator REQUIRED)
|
||||
find_package(httplib REQUIRED)
|
||||
|
||||
if (ENABLE_QT)
|
||||
if (YUZU_USE_BUNDLED_QT)
|
||||
download_qt(6.8.3)
|
||||
|
|
|
@ -44,7 +44,10 @@ function(AddPackage)
|
|||
endif()
|
||||
else()
|
||||
set(PKG_URL ${PKG_ARGS_URL})
|
||||
set(PKG_GIT_URL ${PKG_URL})
|
||||
|
||||
if (DEFINED PKG_ARGS_REPO)
|
||||
set(PKG_GIT_URL https://github.com/${PKG_ARGS_REPO})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "[CPMUtil] ${PKG_ARGS_NAME}: Downloading package from ${PKG_URL}")
|
||||
|
|
24
externals/CMakeLists.txt
vendored
24
externals/CMakeLists.txt
vendored
|
@ -232,11 +232,9 @@ AddPackage(
|
|||
if ((ENABLE_WEB_SERVICE OR ENABLE_QT_UPDATE_CHECKER))
|
||||
AddPackage(
|
||||
NAME httplib
|
||||
VERSION 0.12
|
||||
REPO "yhirose/cpp-httplib"
|
||||
SHA a609330e4c
|
||||
HASH dd3fd0572f8367d8549e1319fd98368b3e75801a293b0c3ac9b4adb806473a4506a484b3d389dc5bee5acc460cb90af7a20e5df705a1696b56496b30b9ce7ed2
|
||||
FIND_PACKAGE_ARGUMENTS "MODULE"
|
||||
OPTIONS
|
||||
"HTTPLIB_REQUIRE_OPENSSL ${ENABLE_OPENSSL}"
|
||||
SYSTEM_PACKAGE ${YUZU_USE_SYSTEM_HTTPLIB}
|
||||
|
@ -259,6 +257,7 @@ if (ENABLE_WEB_SERVICE)
|
|||
PATCHES
|
||||
${CMAKE_SOURCE_DIR}/.patch/cpp-jwt/0001-no-install.patch
|
||||
${CMAKE_SOURCE_DIR}/.patch/cpp-jwt/0002-missing-decl.patch
|
||||
SYSTEM_PACKAGE ON
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -311,9 +310,6 @@ if (VulkanHeaders_ADDED)
|
|||
target_include_directories(Vulkan-Headers INTERFACE ${VulkanHeaders_SOURCE_DIR}/include)
|
||||
endif()
|
||||
|
||||
set(VulkanHeaders_SOURCE_DIR "${VulkanHeaders_SOURCE_DIR}" PARENT_SCOPE)
|
||||
set(VulkanHeaders_ADDED "${VulkanHeaders_ADDED}" PARENT_SCOPE)
|
||||
|
||||
# Vulkan-Utility-Libraries
|
||||
AddPackage(
|
||||
NAME VulkanUtilityLibraries
|
||||
|
@ -323,9 +319,6 @@ AddPackage(
|
|||
BUNDLED_PACKAGE ${YUZU_USE_EXTERNAL_VULKAN_UTILITY_LIBRARIES}
|
||||
)
|
||||
|
||||
set(VulkanUtilityLibraries_SOURCE_DIR "${VulkanUtilityLibraries_SOURCE_DIR}" PARENT_SCOPE)
|
||||
set(VulkanUtilityLibraries_ADDED "${VulkanUtilityLibraries_ADDED}" PARENT_SCOPE)
|
||||
|
||||
# SPIRV-Tools
|
||||
if (YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
||||
AddPackage(
|
||||
|
@ -338,16 +331,6 @@ if (YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
|
|||
)
|
||||
endif()
|
||||
|
||||
# Boost headers
|
||||
if (NOT TARGET Boost::headers)
|
||||
AddPackage(
|
||||
NAME boost_headers
|
||||
REPO "boostorg/headers"
|
||||
SHA 0456900fad
|
||||
HASH 50cd75dcdfc5f082225cdace058f47b4fb114a47585f7aee1d22236a910a80b667186254c214fa2fcebac67ae6d37ba4b6e695e1faea8affd6fd42a03cf996e3
|
||||
)
|
||||
endif()
|
||||
|
||||
# TZDB (Time Zone Database)
|
||||
add_subdirectory(nx_tzdb)
|
||||
|
||||
|
@ -358,12 +341,9 @@ AddPackage(
|
|||
SHA 1076b348ab
|
||||
HASH a46b44e4286d08cffda058e856c47f44c7fed3da55fe9555976eb3907fdcc20ead0b1860b0c38319cda01dbf9b1aa5d4b4038c7f1f8fbd97283d837fa9af9772
|
||||
FIND_PACKAGE_ARGUMENTS "CONFIG"
|
||||
# SYSTEM_PACKAGE ON
|
||||
SYSTEM_PACKAGE ON
|
||||
)
|
||||
|
||||
set(VulkanMemoryAllocator_SOURCE_DIR "${VulkanMemoryAllocator_SOURCE_DIR}" PARENT_SCOPE)
|
||||
set(VulkanMemoryAllocator_ADDED "${VulkanMemoryAllocator_ADDED}" PARENT_SCOPE)
|
||||
|
||||
if (NOT TARGET LLVM::Demangle)
|
||||
add_library(demangle demangle/ItaniumDemangle.cpp)
|
||||
target_include_directories(demangle PUBLIC ./demangle)
|
||||
|
|
|
@ -261,8 +261,13 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(common PUBLIC Boost::algorithm Boost::icl Boost::pool
|
||||
fmt::fmt stb::headers Threads::Threads)
|
||||
if (BOOST_NO_HEADERS)
|
||||
target_link_libraries(common PUBLIC Boost::algorithm Boost::icl Boost::pool)
|
||||
else()
|
||||
target_link_libraries(common PUBLIC Boost::headers)
|
||||
endif()
|
||||
|
||||
target_link_libraries(common PUBLIC fmt::fmt stb::headers Threads::Threads)
|
||||
target_link_libraries(common PRIVATE lz4 LLVM::Demangle)
|
||||
|
||||
if (TARGET libzstd_static)
|
||||
|
|
|
@ -1186,7 +1186,14 @@ endif()
|
|||
|
||||
target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS})
|
||||
target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz)
|
||||
target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API)
|
||||
|
||||
if (BOOST_NO_HEADERS)
|
||||
target_link_libraries(core PUBLIC Boost::container Boost::heap Boost::asio Boost::process Boost::crc)
|
||||
else()
|
||||
target_link_libraries(core PUBLIC Boost::headers)
|
||||
endif()
|
||||
|
||||
target_link_libraries(core PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API)
|
||||
if (MINGW)
|
||||
target_link_libraries(core PRIVATE ${MSWSOCK_LIBRARY})
|
||||
endif()
|
||||
|
|
9
src/dynarmic/externals/CMakeLists.txt
vendored
9
src/dynarmic/externals/CMakeLists.txt
vendored
|
@ -95,6 +95,7 @@ AddPackage(
|
|||
|
||||
# TODO(crueter): maybe it's just Gentoo but zydis system package really sucks
|
||||
if ("x86_64" IN_LIST ARCHITECTURE)
|
||||
# TODO(crueter): system zycore doesn't work with zydis
|
||||
AddPackage(
|
||||
NAME Zycore
|
||||
REPO "zyantific/zycore-c"
|
||||
|
@ -102,8 +103,7 @@ if ("x86_64" IN_LIST ARCHITECTURE)
|
|||
HASH 15aa399f39713e042c4345bc3175c82f14dca849fde2a21d4f591f62c43e227b70d868d8bb86beb5f4eb68b1d6bd3792cdd638acf89009e787e3d10ee7401924
|
||||
OPTIONS
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_Doxygen ON"
|
||||
# BUNDLED_PACKAGE ${DYNARMIC_USE_BUNDLED_EXTERNALS}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
SYSTEM_PACKAGE OFF
|
||||
)
|
||||
|
||||
AddPackage(
|
||||
|
@ -112,13 +112,12 @@ if ("x86_64" IN_LIST ARCHITECTURE)
|
|||
REPO "zyantific/zydis"
|
||||
SHA c2d2bab025
|
||||
HASH 7b48f213ff7aab2926f8c9c65195959143bebbfb2b9a25051ffd8b8b0f1baf1670d9739781de674577d955925f91ac89376e16b476a03828c84e2fd765d45020
|
||||
FIND_PACKAGE_ARGUMENTS "CONFIG"
|
||||
OPTIONS
|
||||
"ZYDIS_BUILD_TOOLS OFF"
|
||||
"ZYDIS_BUILD_EXAMPLES OFF"
|
||||
"ZYDIS_BUILD_DOXYGEN OFF"
|
||||
"ZYAN_ZYCORE_PATH ${Zycore_SOURCE_DIR}"
|
||||
"ZYAN_SYSTEM_ZYCORE ON"
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_Doxygen ON"
|
||||
# BUNDLED_PACKAGE ${DYNARMIC_USE_BUNDLED_EXTERNALS}
|
||||
EXCLUDE_FROM_ALL ON
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -415,12 +415,11 @@ target_link_libraries(dynarmic
|
|||
merry::mcl
|
||||
)
|
||||
|
||||
target_link_libraries(dynarmic
|
||||
PRIVATE
|
||||
Boost::variant
|
||||
Boost::icl
|
||||
Boost::pool
|
||||
)
|
||||
if (BOOST_NO_HEADERS)
|
||||
target_link_libraries(dynarmic PRIVATE Boost::variant Boost::icl Boost::pool)
|
||||
else()
|
||||
target_link_libraries(dynarmic PRIVATE Boost::headers)
|
||||
endif()
|
||||
|
||||
if (DYNARMIC_USE_LLVM)
|
||||
target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS})
|
||||
|
|
|
@ -329,19 +329,7 @@ target_link_options(video_core PRIVATE ${FFmpeg_LDFLAGS})
|
|||
add_dependencies(video_core host_shaders)
|
||||
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
|
||||
|
||||
if (VulkanMemoryAllocator_ADDED)
|
||||
target_include_directories(video_core PUBLIC ${VulkanMemoryAllocator_SOURCE_DIR}/include)
|
||||
endif()
|
||||
|
||||
if (VulkanUtilityLibraries_ADDED)
|
||||
target_include_directories(video_core PUBLIC ${VulkanUtilityLibraries_SOURCE_DIR}/include)
|
||||
endif()
|
||||
|
||||
if (VulkanHeaders_ADDED)
|
||||
target_include_directories(video_core PUBLIC ${VulkanHeaders_SOURCE_DIR}/include)
|
||||
endif()
|
||||
|
||||
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers)
|
||||
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator)
|
||||
|
||||
if (ENABLE_NSIGHT_AFTERMATH)
|
||||
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
|
||||
|
|
1
src/yuzu/externals/CMakeLists.txt
vendored
1
src/yuzu/externals/CMakeLists.txt
vendored
|
@ -20,7 +20,6 @@ AddPackage(
|
|||
REPO "crueter/quazip-qt6"
|
||||
SHA f838774d63
|
||||
HASH 9f629a438699801244a106c8df6d5f8f8d19e80df54f530a89403a10c8c4e37a6e95606bbdd307f23636961e8ce34eb37a2186d589a1f227ac9c8e2c678e326e
|
||||
BUNDLED_PACKAGE ${YUZU_USE_CPM}
|
||||
OPTIONS
|
||||
"QUAZIP_INSTALL OFF"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue