diff --git a/scripts/cargo2android.py b/scripts/cargo2android.py index c88536e5f..9f3dd575a 100755 --- a/scripts/cargo2android.py +++ b/scripts/cargo2android.py @@ -876,8 +876,11 @@ class Runner(object): cmd_tail = ' --target-dir ' + TARGET_TMP + ' >> cargo.out 2>&1' for c in self.cargo: features = '' - if self.args.features and c != 'clean': - features = ' --features ' + self.args.features + if c != 'clean': + if self.args.features is not None: + features = ' --no-default-features' + if self.args.features: + features += ' --features ' + self.args.features cmd = 'cargo -vv ' if self.args.vv else 'cargo -v ' cmd += c + features + cmd_tail if self.args.rustflags and c != 'clean': @@ -1076,7 +1079,9 @@ def parse_args(): default=False, help='run cargo also for a default device target') parser.add_argument( - '--features', type=str, help='passing features to cargo build') + '--features', type=str, + help=('pass features to cargo build, ' + + 'empty string means no default features')) parser.add_argument( '--onefile', action='store_true',