sim: add feature for swap move strategy

Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/Cargo.toml b/sim/Cargo.toml
index b528121..c8e592e 100644
--- a/sim/Cargo.toml
+++ b/sim/Cargo.toml
@@ -12,6 +12,7 @@
 sig-ecdsa = ["mcuboot-sys/sig-ecdsa"]
 sig-ed25519 = ["mcuboot-sys/sig-ed25519"]
 overwrite-only = ["mcuboot-sys/overwrite-only"]
+swap-move = ["mcuboot-sys/swap-move"]
 validate-primary-slot = ["mcuboot-sys/validate-primary-slot"]
 enc-rsa = ["mcuboot-sys/enc-rsa"]
 enc-kw = ["mcuboot-sys/enc-kw"]
diff --git a/sim/mcuboot-sys/Cargo.toml b/sim/mcuboot-sys/Cargo.toml
index d161eb3..3466ff0 100644
--- a/sim/mcuboot-sys/Cargo.toml
+++ b/sim/mcuboot-sys/Cargo.toml
@@ -27,6 +27,8 @@
 # Overwrite only upgrade
 overwrite-only = []
 
+swap-move = []
+
 # Disable validation of the primary slot
 validate-primary-slot = []
 
diff --git a/sim/mcuboot-sys/build.rs b/sim/mcuboot-sys/build.rs
index 197f3ac..c07b2b6 100644
--- a/sim/mcuboot-sys/build.rs
+++ b/sim/mcuboot-sys/build.rs
@@ -14,6 +14,7 @@
     let sig_ecdsa = env::var("CARGO_FEATURE_SIG_ECDSA").is_ok();
     let sig_ed25519 = env::var("CARGO_FEATURE_SIG_ED25519").is_ok();
     let overwrite_only = env::var("CARGO_FEATURE_OVERWRITE_ONLY").is_ok();
+    let swap_move = env::var("CARGO_FEATURE_SWAP_MOVE").is_ok();
     let validate_primary_slot =
                   env::var("CARGO_FEATURE_VALIDATE_PRIMARY_SLOT").is_ok();
     let enc_rsa = env::var("CARGO_FEATURE_ENC_RSA").is_ok();
@@ -111,6 +112,10 @@
         conf.define("MCUBOOT_OVERWRITE_ONLY_FAST", None);
     }
 
+    if swap_move {
+        conf.define("MCUBOOT_SWAP_USING_MOVE", None);
+    }
+
     if enc_rsa {
         conf.define("MCUBOOT_ENCRYPT_RSA", None);
         conf.define("MCUBOOT_ENC_IMAGES", None);
@@ -220,6 +225,9 @@
         conf.file("../../boot/bootutil/src/image_ed25519.c");
     }
     conf.file("../../boot/bootutil/src/loader.c");
+    conf.file("../../boot/bootutil/src/swap_misc.c");
+    conf.file("../../boot/bootutil/src/swap_scratch.c");
+    conf.file("../../boot/bootutil/src/swap_move.c");
     conf.file("../../boot/bootutil/src/caps.c");
     conf.file("../../boot/bootutil/src/bootutil_misc.c");
     conf.file("../../boot/bootutil/src/tlv.c");