diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2020-09-11 11:07:44 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-09-16 22:45:37 +0000 |
commit | 11cd29687c4e338f12112819d6eed28243b0394b (patch) | |
tree | ed95fa64fea5cbdfaf97d0b4725e7bc9a7aa1c95 /mkspecs | |
parent | 09d79fb103dbe41da242a55e3dffc29793b03fe1 (diff) |
Android: allow setting javac build version from the configure script
The configure options -android-javac-source and -android-javac-target
can be used to set the version numbers.
Fixes: QTBUG-86282
Change-Id: I36b0665de2c31e16bf6d138859b5503455eb8e66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 675805e9eb0dc68a6e96622353073fd54161bdaf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/java.prf | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 1d52f05e52..20dc719699 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -20,7 +20,16 @@ CONFIG += plugin no_plugin_name_prefix javac.input = JAVASOURCES javac.output = $$CLASS_DIR javac.CONFIG += combine -javac.commands = javac -source 7 -target 7 -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$system_path($$join(JAVACLASSPATH, $$DIRLIST_SEPARATOR))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN} + +# Check for user defined javac build version +javac_target_version = $$ANDROID_JAVAC_TARGET_VERSION +isEmpty(javac_target_version): javac_target_version = 7 + +javac_source_version = $$ANDROID_JAVAC_SOURCE_VERSION +isEmpty(javac_source_version): javac_source_version = 7 + +javac.commands = javac -source $$javac_source_version -target $$javac_target_version -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$system_path($$join(JAVACLASSPATH, $$DIRLIST_SEPARATOR))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN} + # Force rebuild every time, because we don't know the paths of the destination files # as they depend on the code. javac.depends = FORCE |