Skip to content

Commit

Permalink
Strip debugging symbols from Linux binaries.
Browse files Browse the repository at this point in the history
Doing so reduces the size of the package at the expense of being less friendly
to debug using gdb (GNU's debugger).
  • Loading branch information
bwoodsend committed Dec 16, 2021
1 parent e3ccc5a commit b9275f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setup.py
@@ -1,10 +1,13 @@
from glob import glob
import platform

from setuptools import Extension, setup

dconv_source_files = glob("./deps/double-conversion/double-conversion/*.cc")
dconv_source_files.append("./lib/dconv_wrapper.cc")

strip_flags = ["-Wl,--strip-all"] if platform.system() == "Linux" else []

module1 = Extension(
"ujson",
sources=dconv_source_files
Expand All @@ -17,7 +20,7 @@
],
include_dirs=["./python", "./lib", "./deps/double-conversion/double-conversion"],
extra_compile_args=["-D_GNU_SOURCE"],
extra_link_args=["-lstdc++", "-lm"],
extra_link_args=["-lstdc++", "-lm"] + strip_flags,
)

with open("python/version_template.h") as f:
Expand Down

0 comments on commit b9275f7

Please sign in to comment.