2024-03-11 13:05:37 -05:00
|
|
|
"""Functions used to generate source files during build time"""
|
2024-02-28 14:25:35 +01:00
|
|
|
|
2018-03-17 23:23:55 +01:00
|
|
|
import os
|
2024-05-21 15:14:59 +02:00
|
|
|
|
2018-03-17 23:23:55 +01:00
|
|
|
|
|
|
|
def make_debug_mingw(target, source, env):
|
2024-05-08 11:09:50 +03:00
|
|
|
dst = str(target[0])
|
|
|
|
# Force separate debug symbols if executable size is larger than 1.9 GB.
|
|
|
|
if env["separate_debug_symbols"] or os.stat(dst).st_size >= 2040109465:
|
2024-10-11 14:24:00 -05:00
|
|
|
os.system("{0} --only-keep-debug {1} {1}.debugsymbols".format(env["OBJCOPY"], dst))
|
|
|
|
os.system("{0} --strip-debug --strip-unneeded {1}".format(env["STRIP"], dst))
|
|
|
|
os.system("{0} --add-gnu-debuglink={1}.debugsymbols {1}".format(env["OBJCOPY"], dst))
|