| 1 | """Functions used to generate source files during build time""" |
| 2 | |
| 3 | import os |
| 4 | |
| 5 | |
| 6 | def make_debug_mingw(target, source, env): |
| 7 | dst = str(target[0]) |
| 8 | # Force separate debug symbols if executable size is larger than 1.9 GB. |
| 9 | if env["separate_debug_symbols"] or os.stat(dst).st_size >= 2040109465: |
| 10 | os.system("{0} --only-keep-debug {1} {1}.debugsymbols".format(env["OBJCOPY"], dst)) |
| 11 | os.system("{0} --strip-debug --strip-unneeded {1}".format(env["STRIP"], dst)) |
| 12 | os.system("{0} --add-gnu-debuglink={1}.debugsymbols {1}".format(env["OBJCOPY"], dst)) |