diff --git a/setup.py b/setup.py index 453dc317..3a6c581e 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,19 @@ import platform from glob import glob +from os import environ 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 [] +if platform.system() == "Linux" and environ.get("UJSON_BUILD_NO_STRIP", "0") not in ( + "1", + "True", +): + strip_flags = ["-Wl,--strip-all"] +else: + strip_flags = [] module1 = Extension( "ujson",