From c98b63ae7240530e77af09c8fa78788097180313 Mon Sep 17 00:00:00 2001 From: AliMehrabani Date: Tue, 19 Nov 2024 18:15:52 +0330 Subject: [PATCH] build for android It build the project for android but cannot deploy! --- VkTest.pro | 21 +++++++++++++++------ VkTest.pro.user | 7 +++++-- VulkanTutorial1.0/Types.h | 2 -- VulkanTutorial1.0/VulkanWindow.h | 4 ++-- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/VkTest.pro b/VkTest.pro index 96bde42..df4aea9 100644 --- a/VkTest.pro +++ b/VkTest.pro @@ -46,12 +46,19 @@ android { QT += \ ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android + NDK_PATH = /home/ali-mehrabani/host-projects/Android/Sdk/ndk/21.0.6113669 INCLUDEPATH += \ +# /usr/include/vulkan \ + $$NDK_PATH/platforms/android-29/arch-arm64/usr/lib/ - LIBS += -landroid -llog + LIBS += -landroid -llog \ + -L$$NDK_PATH/platforms/android-29/arch-arm64/usr/lib -lvulkan - DEFINES += VK_USE_PLATFORM_ANDROID_KHR + DEFINES += \ + VK_USE_PLATFORM_ANDROID_KHR + +# ANDROID_ABIS = arm64-v8a armeabi-v7a OTHER_FILES += android/src/Vulkan \ android/AndroidManifest.xml \ @@ -62,12 +69,14 @@ android { android/gradlew.bat \ android/res/values/libs.xml } -linux64 { - QT += x11extrass +linux-g++* { + QT += x11extras LIBS += \ - -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi \ - -lvulkan \ + -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi -lvulkan \ + + DEFINES += \ + VK_USE_PLATFORM_XCB_KHR INCLUDEPATH += \ /usr/include/vulkan \ diff --git a/VkTest.pro.user b/VkTest.pro.user index 5704080..3bd05a8 100644 --- a/VkTest.pro.user +++ b/VkTest.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -567,7 +567,10 @@ Qt4ProjectManager.AndroidDeployConfiguration2 1 - + + 2161d2080d017ece + 29 + dwarf diff --git a/VulkanTutorial1.0/Types.h b/VulkanTutorial1.0/Types.h index 29d4a06..7402e77 100644 --- a/VulkanTutorial1.0/Types.h +++ b/VulkanTutorial1.0/Types.h @@ -1,8 +1,6 @@ #ifndef TYPES_H #define TYPES_H -#pragma once - #include #include diff --git a/VulkanTutorial1.0/VulkanWindow.h b/VulkanTutorial1.0/VulkanWindow.h index 1d45e8d..331b0b9 100644 --- a/VulkanTutorial1.0/VulkanWindow.h +++ b/VulkanTutorial1.0/VulkanWindow.h @@ -8,11 +8,11 @@ #include "Types.h" #if defined(Q_OS_ANDROID) -#define VK_USE_PLATFORM_ANDROID_KHR // Enable Vulkan support for Android +//#define VK_USE_PLATFORM_ANDROID_KHR // Enable Vulkan support for Android (added to qmake file) #include #elif defined(Q_OS_LINUX) #include -#define VK_USE_PLATFORM_XCB_KHR // Enable Vulkan support for Linux (XCB) +//#define VK_USE_PLATFORM_XCB_KHR // Enable Vulkan support for Linux (XCB) (added to qmake file) #include #include #endif