[WIP] cmake build for android
This commit is contained in:
parent
ad7fc937a9
commit
ad4b3dfad1
7 changed files with 17 additions and 16 deletions
|
|
@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.23.0 FATAL_ERROR)
|
||||||
set(PROJECT AmneziaVPN)
|
set(PROJECT AmneziaVPN)
|
||||||
project(${PROJECT})
|
project(${PROJECT})
|
||||||
|
|
||||||
|
#if(ANDROID)
|
||||||
|
# set(QT_ANDROID_BUILD_ALL_ABIS ON)
|
||||||
|
#endif()
|
||||||
|
|
||||||
add_subdirectory(client)
|
add_subdirectory(client)
|
||||||
|
|
||||||
if(NOT IOS AND NOT ANDROID)
|
if(NOT IOS AND NOT ANDROID)
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,15 @@ if(ANDROID)
|
||||||
# We need to include qtprivate api's
|
# We need to include qtprivate api's
|
||||||
# As QAndroidBinder is not yet implemented with a public api
|
# As QAndroidBinder is not yet implemented with a public api
|
||||||
set(LIBS ${LIBS} Qt6::CorePrivate)
|
set(LIBS ${LIBS} Qt6::CorePrivate)
|
||||||
set(ANDROID_ABIS ANDROID_TARGET_ARCH)
|
|
||||||
|
|
||||||
link_directories(${CMAKE_CURRENT_LIST_DIR}/android/${ANDROID_TARGET_ARCH})
|
message("botan target arch ${CMAKE_ANDROID_ARCH_ABI}")
|
||||||
set(HEADERS ${HEADERS} ${CMAKE_CURRENT_LIST_DIR}/android/${ANDROID_TARGET_ARCH}/botan_all.h)
|
set(abi ${CMAKE_ANDROID_ARCH_ABI})
|
||||||
set(SOURCES ${SOURCES} ${CMAKE_CURRENT_LIST_DIR}/android/${ANDROID_TARGET_ARCH}/botan_all.cpp)
|
|
||||||
|
include_directories(${CMAKE_CURRENT_LIST_DIR}/android/${abi})
|
||||||
|
link_directories(${CMAKE_CURRENT_LIST_DIR}/android/${abi})
|
||||||
|
set(HEADERS ${HEADERS} ${CMAKE_CURRENT_LIST_DIR}/android/${abi}/botan_all.h)
|
||||||
|
set(SOURCES ${SOURCES} ${CMAKE_CURRENT_LIST_DIR}/android/${abi}/botan_all.cpp)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(IOS)
|
if(IOS)
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ if(ANDROID)
|
||||||
# We need to include qtprivate api's
|
# We need to include qtprivate api's
|
||||||
# As QAndroidBinder is not yet implemented with a public api
|
# As QAndroidBinder is not yet implemented with a public api
|
||||||
set(LIBS ${LIBS} Qt6::CorePrivate)
|
set(LIBS ${LIBS} Qt6::CorePrivate)
|
||||||
set(ANDROID_ABIS ANDROID_TARGET_ARCH)
|
# set(ANDROID_ABIS ANDROID_TARGET_ARCH)
|
||||||
|
|
||||||
add_compile_definitions(MVPN_ANDROID)
|
add_compile_definitions(MVPN_ANDROID)
|
||||||
|
|
||||||
|
|
@ -283,7 +283,7 @@ if(ANDROID)
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCES ${SOURCES}
|
set(SOURCES ${SOURCES}
|
||||||
${CMAKE_CURRENT_LIST_DIR}/platforms/android/android_controller.cp
|
${CMAKE_CURRENT_LIST_DIR}/platforms/android/android_controller.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/platforms/android/android_notificationhandler.cpp
|
${CMAKE_CURRENT_LIST_DIR}/platforms/android/android_notificationhandler.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/platforms/android/androidutils.cpp
|
${CMAKE_CURRENT_LIST_DIR}/platforms/android/androidutils.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/platforms/android/androidvpnactivity.cpp
|
${CMAKE_CURRENT_LIST_DIR}/platforms/android/androidvpnactivity.cpp
|
||||||
|
|
@ -469,8 +469,6 @@ set_source_files_properties(
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(QT_ANDROID_BUILD_ALL_ABIS ON)
|
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${PROJECT} POST_BUILD
|
TARGET ${PROJECT} POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,6 @@
|
||||||
#include "ui/uilogic.h"
|
#include "ui/uilogic.h"
|
||||||
#include "ui/pages_logic/StartPageLogic.h"
|
#include "ui/pages_logic/StartPageLogic.h"
|
||||||
|
|
||||||
#if defined(Q_OS_ANDROID)
|
|
||||||
#include "android_controller.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace amnezia;
|
using namespace amnezia;
|
||||||
using namespace PageEnumNS;
|
using namespace PageEnumNS;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#include "vpnconnection.h"
|
#include "vpnconnection.h"
|
||||||
|
|
||||||
#include "../uilogic.h"
|
#include "../uilogic.h"
|
||||||
#include "ServerListLogic.h"
|
|
||||||
#include "ShareConnectionLogic.h"
|
#include "ShareConnectionLogic.h"
|
||||||
#include "VpnLogic.h"
|
#include "VpnLogic.h"
|
||||||
|
|
||||||
|
|
@ -11,7 +10,7 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
#include "androidutils.h"
|
#include "../../platforms/android/androidutils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ServerSettingsLogic::ServerSettingsLogic(UiLogic *logic, QObject *parent):
|
ServerSettingsLogic::ServerSettingsLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
#include <QJniObject>
|
#include <QJniObject>
|
||||||
#include "androidutils.h"
|
#include "../../platforms/android/androidutils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent):
|
StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_OS_ANDROID
|
||||||
#include "android_controller.h"
|
#include "../../platforms/android/android_controller.h"
|
||||||
#include "protocols/android_vpnprotocol.h"
|
#include "protocols/android_vpnprotocol.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue