Skip to content

Commit aace65c

Browse files
committed
Another attempt at the cibuildwheel debug issue
1 parent c945f04 commit aace65c

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

setup.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,25 @@ def initialize_options(self):
557557
def finalize_options(self):
558558
v = beparent.finalize_options(self)
559559

560+
if os.environ.get("CIBUILDWHEEL"):
561+
# https://github.com/pypa/cibuildwheel/issues/331
562+
match sys.platform:
563+
case "linux":
564+
for ext in self.extensions:
565+
ext.extra_compile_args = ["-g0"]
566+
ext.extra_link_args = ["-Wl,--strip-debug"]
567+
case "darwin":
568+
for ext in self.extensions:
569+
ext.extra_compile_args = ["-g0"]
570+
ext.extra_link_args = ["-S"]
571+
case "win32":
572+
for ext in self.extensions:
573+
ext.extra_link_args = ["/DEBUG:NONE"]
574+
case _:
575+
# cibuildwheel doesn't support other platforms
576+
pass
577+
578+
560579
if self.enable_all_extensions:
561580
if self.use_system_sqlite_config:
562581
raise OptionError("You can't enable both all extensions **and** using system SQLite config")

0 commit comments

Comments
 (0)