[cmake] fix android, boost headers
All checks were successful
eden-license / license-header (pull_request) Successful in 19s

boost sucks

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2025-08-15 18:40:44 -04:00
parent 54d259bb4c
commit 79e73bd0e9
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
4 changed files with 55 additions and 40 deletions

View file

@ -57,14 +57,7 @@ option(ENABLE_QT_UPDATE_CHECKER "Enable update checker for the Qt frontend" OFF)
CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF) CMAKE_DEPENDENT_OPTION(YUZU_USE_BUNDLED_QT "Download bundled Qt binaries" "${MSVC}" "ENABLE_QT" OFF)
# TODO(crueter): maybe this should default on everywhere...? option(YUZU_USE_CPM "Use CPM to fetch Eden dependencies if needed" ON)
if (MSVC OR ANDROID)
set(CPM_DEFAULT ON)
else()
set(CPM_DEFAULT OFF)
endif()
option(YUZU_USE_CPM "Use CPM for Eden dependencies" "${CPM_DEFAULT}")
option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON) option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF) option(ENABLE_WIFI_SCAN "Enable WiFi scanning" OFF)
@ -436,6 +429,10 @@ if (YUZU_USE_CPM)
VERSION 1.57 VERSION 1.57
) )
# really annoying thing where boost::headers doesn't work with cpm
# TODO(crueter) investigate
set(BOOST_NO_HEADERS ${Boost_ADDED})
if (Boost_ADDED) if (Boost_ADDED)
if (MSVC OR ANDROID) if (MSVC OR ANDROID)
add_compile_definitions(YUZU_BOOST_v1) add_compile_definitions(YUZU_BOOST_v1)
@ -484,15 +481,6 @@ if (YUZU_USE_CPM)
VERSION 3.8 VERSION 3.8
) )
# SimpleIni
AddPackage(
NAME SimpleIni
REPO brofield/simpleini
SHA 09c21bda1d
HASH 99779ca9b6e040d36558cadf484f9ffdab5b47bcc8fc72e4d33639d1d60c0ceb4410d335ba445d72a4324e455167fd6769d99b459943aa135bec085dff2d4b7c
EXCLUDE_FROM_ALL ON
)
# zlib # zlib
AddPackage( AddPackage(
NAME ZLIB NAME ZLIB
@ -544,6 +532,10 @@ if (YUZU_USE_CPM)
FIND_PACKAGE_ARGUMENTS "MODULE" FIND_PACKAGE_ARGUMENTS "MODULE"
) )
if (enet_ADDED)
target_include_directories(enet INTERFACE ${enet_SOURCE_DIR}/include)
endif()
# Opus # Opus
AddPackage( AddPackage(
NAME Opus NAME Opus
@ -595,25 +587,6 @@ if (YUZU_USE_CPM)
endif() endif()
endif() endif()
endif() endif()
# DiscordRPC
if (USE_DISCORD_PRESENCE)
AddPackage(
NAME discord-rpc
REPO "discord/discord-rpc"
SHA 963aa9f3e5
HASH 386e1344e9a666d730f2d335ee3aef1fd05b1039febefd51aa751b705009cc764411397f3ca08dffd46205c72f75b235c870c737b2091a4ed0c3b061f5919bde
OPTIONS
"BUILD_EXAMPLES OFF"
PATCHES
${CMAKE_SOURCE_DIR}/.patch/discord-rpc/0001-cmake-version.patch
${CMAKE_SOURCE_DIR}/.patch/discord-rpc/0002-no-clang-format.patch
${CMAKE_SOURCE_DIR}/.patch/discord-rpc/0003-fix-cpp17.patch
)
target_include_directories(discord-rpc INTERFACE ${discord-rpc_SOURCE_DIR}/include)
add_library(DiscordRPC::discord-rpc ALIAS discord-rpc)
endif()
else() else()
# Enforce the search mode of non-required packages for better and shorter failure messages # Enforce the search mode of non-required packages for better and shorter failure messages
find_package(fmt 8 REQUIRED) find_package(fmt 8 REQUIRED)
@ -621,7 +594,6 @@ else()
find_package(nlohmann_json 3.8 REQUIRED) find_package(nlohmann_json 3.8 REQUIRED)
find_package(lz4 REQUIRED) find_package(lz4 REQUIRED)
find_package(RenderDoc MODULE) find_package(RenderDoc MODULE)
find_package(SimpleIni MODULE)
find_package(stb MODULE) find_package(stb MODULE)
find_package(enet 1.3 MODULE) find_package(enet 1.3 MODULE)
find_package(Opus 1.3 MODULE) find_package(Opus 1.3 MODULE)
@ -663,6 +635,35 @@ if (ENABLE_LIBUSB)
endif() endif()
endif() endif()
# DiscordRPC
if (USE_DISCORD_PRESENCE)
AddPackage(
NAME discord-rpc
REPO "discord/discord-rpc"
SHA 963aa9f3e5
HASH 386e1344e9a666d730f2d335ee3aef1fd05b1039febefd51aa751b705009cc764411397f3ca08dffd46205c72f75b235c870c737b2091a4ed0c3b061f5919bde
OPTIONS
"BUILD_EXAMPLES OFF"
PATCHES
${CMAKE_SOURCE_DIR}/.patch/discord-rpc/0001-cmake-version.patch
${CMAKE_SOURCE_DIR}/.patch/discord-rpc/0002-no-clang-format.patch
${CMAKE_SOURCE_DIR}/.patch/discord-rpc/0003-fix-cpp17.patch
)
target_include_directories(discord-rpc INTERFACE ${discord-rpc_SOURCE_DIR}/include)
add_library(DiscordRPC::discord-rpc ALIAS discord-rpc)
endif()
# SimpleIni
AddPackage(
NAME SimpleIni
REPO brofield/simpleini
SHA 09c21bda1d
HASH 99779ca9b6e040d36558cadf484f9ffdab5b47bcc8fc72e4d33639d1d60c0ceb4410d335ba445d72a4324e455167fd6769d99b459943aa135bec085dff2d4b7c
EXCLUDE_FROM_ALL ON
FIND_PACKAGE_ARGUMENTS "MODULE"
)
# TODO(crueter): Work around this # TODO(crueter): Work around this
if (NOT YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS) if (NOT YUZU_USE_EXTERNAL_VULKAN_SPIRV_TOOLS)
find_package(PkgConfig REQUIRED) find_package(PkgConfig REQUIRED)

View file

@ -261,7 +261,11 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
) )
endif() endif()
target_link_libraries(common PUBLIC Boost::headers) if (BOOST_NO_HEADERS)
target_link_libraries(common PUBLIC Boost::algorithm Boost::icl Boost::pool)
else()
target_link_libraries(common PUBLIC Boost::headers)
endif()
if (lz4_ADDED) if (lz4_ADDED)
target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib) target_include_directories(common PRIVATE ${lz4_SOURCE_DIR}/lib)

View file

@ -1185,7 +1185,13 @@ else()
endif() endif()
target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS}) target_include_directories(core PRIVATE ${OPUS_INCLUDE_DIRS})
target_link_libraries(core PUBLIC common Boost::headers PRIVATE audio_core hid_core network video_core nx_tzdb tz) target_link_libraries(core PUBLIC common PRIVATE audio_core hid_core network video_core nx_tzdb tz)
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) target_link_libraries(core PRIVATE fmt::fmt nlohmann_json::nlohmann_json mbedtls RenderDoc::API)
if (MINGW) if (MINGW)

View file

@ -415,7 +415,11 @@ target_link_libraries(dynarmic
merry::mcl merry::mcl
) )
target_link_libraries(dynarmic PRIVATE Boost::headers) 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) if (DYNARMIC_USE_LLVM)
target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS}) target_include_directories(dynarmic PRIVATE ${LLVM_INCLUDE_DIRS})