meson: Define ANDROID and ANDROID_API_LEVEL when compiling for Android
authorKristian H. Kristensen <hoegsberg@google.com>
Wed, 29 Jul 2020 08:09:23 +0000 (01:09 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 5 Aug 2020 18:08:07 +0000 (18:08 +0000)
Set ANDROID_API_LEVEL based on the value we already have and define
ANDROID to make sure we build code paths that are guarded by that.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6112>

meson.build

index a019e4d8d412fea18c25542ccd7425d2fdd6887e..39c49775c4418f303907470675c82966ae1d335b 100644 (file)
@@ -854,7 +854,11 @@ if with_platform_android
       dep_android += dependency('nativewindow')
     endif
   endif
-  pre_args += '-DHAVE_ANDROID_PLATFORM'
+  pre_args += [
+    '-DHAVE_ANDROID_PLATFORM',
+    '-DANDROID',
+    '-DANDROID_API_LEVEL=' + get_option('platform-sdk-version').to_string()
+  ]
 endif
 if with_platform_haiku
   pre_args += '-DHAVE_HAIKU_PLATFORM'