Fix build on Android x86_64 target (#92)

* Fix build on Android x86_64 target

* Fixed formatting
This commit is contained in:
Oil 2025-04-09 19:18:45 +03:00 committed by GitHub
parent 115c51d3ae
commit 4365718460
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -395,7 +395,7 @@ else()
add_library(3rdparty::libusb ALIAS usb-1.0-static)
endif()
if (ANDROID)
if (ANDROID AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
add_subdirectory(libadrenotools)
else()
add_library(adrenotools INTERFACE)

View file

@ -4,12 +4,15 @@
#ifdef ANDROID
#include <fstream>
#include "libadrenotools/include/adrenotools/priv.h"
#include <libadrenotools/include/adrenotools/driver.h>
#include <dlfcn.h>
#include <nlohmann/json.hpp>
#endif
#if defined(ANDROID) && defined(ARCH_ARM64)
#include "libadrenotools/include/adrenotools/priv.h"
#include <libadrenotools/include/adrenotools/driver.h>
#endif
namespace vk
{
// Supported extensions
@ -80,7 +83,7 @@ namespace vk
VK_GET_SYMBOL(vkDestroyInstance)(m_instance, nullptr);
m_instance = VK_NULL_HANDLE;
#ifdef ANDROID
#if defined(ANDROID) && defined(ARCH_ARM64)
if (owns_loader && g_vk_loader != nullptr)
{
adrenotools_set_turbo(false);
@ -116,7 +119,7 @@ namespace vk
#endif
bool instance::create(const char* app_name, bool fast)
{
#ifdef ANDROID
#if defined(ANDROID) && defined(ARCH_ARM64)
if (g_vk_loader == nullptr)
{
auto custom_driver_path = g_cfg.video.vk.driver.path.to_string();