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 += \
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 \

7
VkTest.pro.user

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<data>
<variable>EnvironmentId</variable>
@ -567,7 +567,10 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.AndroidDeployConfiguration2</value>
</valuemap>
<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">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">

2
VulkanTutorial1.0/Types.h

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

4
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 <vulkan/vulkan_android.h>
#elif defined(Q_OS_LINUX)
#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 <QX11Info>
#endif

Loading…
Cancel
Save