Browse Source

build for android

It build the project for android but cannot deploy!
master
AliMehrabani 6 days ago
parent
commit
c98b63ae72
  1. 21
      VkTest.pro
  2. 7
      VkTest.pro.user
  3. 2
      VulkanTutorial1.0/Types.h
  4. 4
      VulkanTutorial1.0/VulkanWindow.h

21
VkTest.pro

@ -46,12 +46,19 @@ android {
QT += \ QT += \
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
NDK_PATH = /home/ali-mehrabani/host-projects/Android/Sdk/ndk/21.0.6113669
INCLUDEPATH += \ 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 \ OTHER_FILES += android/src/Vulkan \
android/AndroidManifest.xml \ android/AndroidManifest.xml \
@ -62,12 +69,14 @@ android {
android/gradlew.bat \ android/gradlew.bat \
android/res/values/libs.xml android/res/values/libs.xml
} }
linux64 { linux-g++* {
QT += x11extrass QT += x11extras
LIBS += \ LIBS += \
-lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi \ -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi -lvulkan \
-lvulkan \
DEFINES += \
VK_USE_PLATFORM_XCB_KHR
INCLUDEPATH += \ INCLUDEPATH += \
/usr/include/vulkan \ /usr/include/vulkan \

7
VkTest.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.10.1, 2024-11-19T11:35:57. --> <!-- Written by QtCreator 4.10.1, 2024-11-19T18:15:28. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@ -567,7 +567,10 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidDeployConfiguration2</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidDeployConfiguration2</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings">
<value type="QString" key="AndroidDeviceSerialNumber">2161d2080d017ece</value>
<value type="int" key="AndroidVersion.ApiLevel">29</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value> <value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events"> <valuelist type="QVariantList" key="Analyzer.Perf.Events">

2
VulkanTutorial1.0/Types.h

@ -1,8 +1,6 @@
#ifndef TYPES_H #ifndef TYPES_H
#define TYPES_H #define TYPES_H
#pragma once
#include <vulkan/vulkan.h> #include <vulkan/vulkan.h>
#include <iostream> #include <iostream>

4
VulkanTutorial1.0/VulkanWindow.h

@ -8,11 +8,11 @@
#include "Types.h" #include "Types.h"
#if defined(Q_OS_ANDROID) #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 <vulkan/vulkan_android.h> #include <vulkan/vulkan_android.h>
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
#include <xcb/xcb.h> #include <xcb/xcb.h>
#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 <vulkan/vulkan_xcb.h> #include <vulkan/vulkan_xcb.h>
#include <QX11Info> #include <QX11Info>
#endif #endif

Loading…
Cancel
Save