platform_windows_builders.py 753 B

123456789101112131415161718192021222324
  1. """Functions used to generate source files during build time
  2. All such functions are invoked in a subprocess on Windows to prevent build flakiness.
  3. """
  4. import os
  5. from platform_methods import subprocess_main
  6. def make_debug_mingw(target, source, env):
  7. mingw_prefix = ""
  8. if env["bits"] == "32":
  9. mingw_prefix = env["mingw_prefix_32"]
  10. else:
  11. mingw_prefix = env["mingw_prefix_64"]
  12. os.system(mingw_prefix + "objcopy --only-keep-debug {0} {0}.debugsymbols".format(target[0]))
  13. os.system(mingw_prefix + "strip --strip-debug --strip-unneeded {0}".format(target[0]))
  14. os.system(mingw_prefix + "objcopy --add-gnu-debuglink={0}.debugsymbols {0}".format(target[0]))
  15. if __name__ == "__main__":
  16. subprocess_main(globals())