From 5c2f285fc06a2c5855a47554a60a47de68ab73a6 Mon Sep 17 00:00:00 2001 From: Sebastian Streich Date: Mon, 31 Oct 2022 14:46:00 +0100 Subject: [PATCH] Windows related fixes --- android/buildSrc/src/main/kotlin/Config.kt | 3 ++- android/buildSrc/src/main/kotlin/QtConfig.kt | 13 +++++++++---- android/client/build.gradle | 15 +++------------ android/daemon/build.gradle | 2 +- src/CMakeLists.txt | 5 ++++- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/android/buildSrc/src/main/kotlin/Config.kt b/android/buildSrc/src/main/kotlin/Config.kt index 70a8da3bf3..5e082a82c4 100644 --- a/android/buildSrc/src/main/kotlin/Config.kt +++ b/android/buildSrc/src/main/kotlin/Config.kt @@ -7,5 +7,6 @@ object Config { const val buildToolsVersion = "30.0.3" const val minSdkVersion = 24 const val targetSdkVersion = 30 - const val ndkVersion = "24.0.8215888" + const val ndkVersion = "23.1.7779620" + const val cmakeVersion = "3.18.1" } diff --git a/android/buildSrc/src/main/kotlin/QtConfig.kt b/android/buildSrc/src/main/kotlin/QtConfig.kt index a3d82a5d26..e7410062f9 100644 --- a/android/buildSrc/src/main/kotlin/QtConfig.kt +++ b/android/buildSrc/src/main/kotlin/QtConfig.kt @@ -171,10 +171,15 @@ open class QTConfigurationExtension if (abi.isEmpty()) { return JSONArray() } - val importScanner = File("$host/libexec/qmlimportscanner") - if (!importScanner.exists()) { - error("Did not found qmlimportscanner in $host/libexec/qmlimportscanner") - } + val importScannerList = arrayOf( + File("$host/libexec/qmlimportscanner"), + File("$host/bin/qmlimportscanner"), + File("$host/bin/qmlimportscanner.exe"), + ) + val importScanner = importScannerList.firstOrNull{it.exists()} + ?: { + error("Did not found qmlimportscanner in ${importScannerList}") + } val repo_path = project.rootProject.projectDir.parent val qmlPath = File("$repo_path/src/ui") val qtQMLPath = File("$abi/qml") diff --git a/android/client/build.gradle b/android/client/build.gradle index 7aff4a79ee..d8369c10a2 100644 --- a/android/client/build.gradle +++ b/android/client/build.gradle @@ -16,7 +16,7 @@ dependencies { android { - ndkVersion '24.0.8215888' + ndkVersion "23.1.7779620" compileSdkVersion Config.compileSdkVersion defaultConfig { minSdkVersion Config.minSdkVersion @@ -40,7 +40,7 @@ android { externalNativeBuild { cmake { - version "3.18.1" + version Config.cmakeVersion path '../../CMakeLists.txt' } } @@ -51,6 +51,7 @@ android { // Passes optional arguments to CMake. arguments "-DANDROID_QT_DIR=${QtConfiguration.qtAndroidRootDir}", "-DQT_HOST_PATH=${QtConfiguration.host}", + "-DQT_NO_WARN_BUILD_TREE_APK_DEPS=ON", "-DQT_HOST_PATH_CMAKE_DIR=${QtConfiguration.host}/lib/cmake", "-DANDROID_STL=c++_shared", "--target mozillavpn" @@ -105,13 +106,3 @@ task importOpenSSL(type: Copy) { into("build/ssl") } preBuild.dependsOn importOpenSSL - -tasks.whenTaskAdded { - theTask -> - if (theTask.name.contains('externalNativeBuild')) { - theTask.doLast{ - println "[*] begin to copy file." - } - } - println theTask.name -} \ No newline at end of file diff --git a/android/daemon/build.gradle b/android/daemon/build.gradle index 9d990281aa..8532296998 100644 --- a/android/daemon/build.gradle +++ b/android/daemon/build.gradle @@ -67,7 +67,7 @@ android { externalNativeBuild { cmake { - version "3.10.2" + version Config.cmakeVersion path 'tunnel/CMakeLists.txt' } } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 14d55811dd..72a26d2712 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,4 +57,7 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten") target_link_libraries(mozillavpn PRIVATE crashreporter) endif() -qt_finalize_target(mozillavpn) + +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android") + qt_finalize_target(mozillavpn) +endif() \ No newline at end of file