From 5000cc555eb35292e3819f73ee497957d1311ab0 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sun, 24 Jun 2018 19:15:36 -0400 Subject: [PATCH] android: define __ANDROID_API__ in cflags This is needed for targeting older apis. --- pkgs/development/mobile/androidenv/androidndk-pkgs.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/mobile/androidenv/androidndk-pkgs.nix b/pkgs/development/mobile/androidenv/androidndk-pkgs.nix index 011b8eb00994..0f43705c0d42 100644 --- a/pkgs/development/mobile/androidenv/androidndk-pkgs.nix +++ b/pkgs/development/mobile/androidenv/androidndk-pkgs.nix @@ -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 [