Skip to content

Commit 16f1230

Browse files
committed
Strip debug information from release package by default
1 parent 67c7af3 commit 16f1230

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Android/android.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,14 @@ def package(context):
677677
else:
678678
shutil.copy2(src, dst, follow_symlinks=False)
679679

680+
# Strip debug information.
681+
if not context.debug:
682+
run(
683+
[android_env(context.host)["STRIP"]]
684+
+ glob(f"{temp_dir}/**/*.so", recursive=True),
685+
log=False,
686+
)
687+
680688
dist_dir = subdir(context.host, "dist", create=True)
681689
package_path = shutil.make_archive(
682690
f"{dist_dir}/python-{version}-{context.host}", "gztar", temp_dir
@@ -773,6 +781,11 @@ def add_parser(*args, **kwargs):
773781
"args", nargs="*", help=f"Arguments to add to sys.argv. "
774782
f"Separate them from {SCRIPT_NAME}'s own arguments with `--`.")
775783

784+
# Package arguments.
785+
package.add_argument(
786+
"-g", action="store_true", default=False, dest="debug",
787+
help="Include debug information")
788+
776789
return parser.parse_args()
777790

778791

0 commit comments

Comments
 (0)