diff --git a/android/buildSrc/src/main/groovy/FilamentPlugin.groovy b/android/buildSrc/src/main/groovy/FilamentPlugin.groovy index e32fcc249e..10f0b5e0c5 100644 --- a/android/buildSrc/src/main/groovy/FilamentPlugin.groovy +++ b/android/buildSrc/src/main/groovy/FilamentPlugin.groovy @@ -142,6 +142,14 @@ abstract class MaterialCompiler extends TaskWithBinary { if (!exclude_vulkan) { matcArgs += ['-a', 'vulkan'] } + + def mat_no_opt = providers + .gradleProperty("com.google.android.filament.matnopt") + .forUseAtConfigurationTime().present + if (mat_no_opt) { + matcArgs += ['-g'] + } + matcArgs += ['-a', 'opengl', '-p', 'mobile', '-o', getOutputFile(file), file] exec.exec { diff --git a/build.sh b/build.sh index c59ee22608..b7916a1623 100755 --- a/build.sh +++ b/build.sh @@ -491,6 +491,7 @@ function build_android { ./gradlew \ -Pcom.google.android.filament.dist-dir=../out/android-debug/filament \ -Pcom.google.android.filament.abis=${ABI_GRADLE_OPTION} \ + ${MATOPT_GRADLE_OPTION} \ :samples:${sample}:assembleDebug done fi @@ -539,6 +540,7 @@ function build_android { ./gradlew \ -Pcom.google.android.filament.dist-dir=../out/android-release/filament \ -Pcom.google.android.filament.abis=${ABI_GRADLE_OPTION} \ + ${MATOPT_GRADLE_OPTION} \ :samples:${sample}:assembleRelease done fi @@ -756,7 +758,7 @@ function run_tests { pushd "$(dirname "$0")" > /dev/null -while getopts ":hacCfijmp:q:uvslwtedk:b" opt; do +while getopts ":hacCfgijmp:q:uvslwtedk:b" opt; do case ${opt} in h) print_help