aws-sdk-cpp: fix cross-OS crosscompilation (#133182)

The TARGET_ARCH cmake variable is used to specify the host OS, which if
unspecified defaults to the same as the build OS. So to crosscompile
aws-sdk-cpp to another OS, the TARGET_ARCH variable must be specified.

Example hydra failure: https://hydra.nixos.org/build/149290553/nixlog/3

authored by

r-burns and committed by
GitHub
d63e4e23 bf906eaf

+9
+9
pkgs/development/libraries/aws-sdk-cpp/default.nix
··· 7 7 customMemoryManagement ? true 8 8 }: 9 9 10 + let 11 + host_os = if stdenv.hostPlatform.isDarwin then "APPLE" 12 + else if stdenv.hostPlatform.isAndroid then "ANDROID" 13 + else if stdenv.hostPlatform.isWindows then "WINDOWS" 14 + else if stdenv.hostPlatform.isLinux then "LINUX" 15 + else throw "Unknown host OS"; 16 + in 17 + 10 18 stdenv.mkDerivation rec { 11 19 pname = "aws-sdk-cpp"; 12 20 version = "1.8.130"; ··· 49 57 "-DENABLE_TESTING=OFF" 50 58 "-DCURL_HAS_H2=1" 51 59 "-DCURL_HAS_TLS_PROXY=1" 60 + "-DTARGET_ARCH=${host_os}" 52 61 ] ++ lib.optional (apis != ["*"]) 53 62 "-DBUILD_ONLY=${lib.concatStringsSep ";" apis}"; 54 63