android: define __ANDROID_API__ in cflags

This is needed for targeting older apis.
This commit is contained in:
Matthew Bauer 2018-06-24 19:15:36 -04:00
parent 2c2169c881
commit 5000cc555e

View File

@ -67,7 +67,10 @@ rec {
cc = binaries;
bintools = binutils;
libc = targetAndroidndkPkgs.libraries;
extraBuildCommands = lib.optionalString targetPlatform.isAarch32 (let
extraBuildCommands = ''
echo "-D__ANDROID_API__=${targetPlatform.sdkVer}" >> $out/nix-support/cc-cflags
''
+ lib.optionalString targetPlatform.isAarch32 (let
p = targetPlatform.platform.gcc or {}
// targetPlatform.parsed.abi;
flags = lib.concatLists [