summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/libraries/aws-sdk-cpp/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix
index 22fb9facfea..6a881e4245a 100644
--- a/pkgs/development/libraries/aws-sdk-cpp/default.nix
+++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix
@@ -1,4 +1,9 @@
-{ lib, stdenv, fetchFromGitHub, cmake, curl }:
+{ lib, stdenv, fetchFromGitHub, cmake, curl
+, # Allow building a limited set of APIs, e.g. ["s3" "ec2"].
+  apis ? ["*"]
+, # Whether to enable AWS' custom memory management.
+  customMemoryManagement ? true
+}:
 
 stdenv.mkDerivation rec {
   name = "aws-sdk-cpp-${version}";
@@ -13,9 +18,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ cmake curl ];
 
-  # FIXME: provide flags to build only part of the SDK, or put them in
-  # different outputs.
-  # cmakeFlags = "-DBUILD_ONLY=aws-cpp-sdk-s3";
+  cmakeFlags =
+    lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
+    ++ lib.optional (apis != ["*"])
+      "-DBUILD_ONLY=${lib.concatMapStringsSep ";" (api: "aws-cpp-sdk-" + api) apis}";
 
   enableParallelBuilding = true;