gen_swiftc_output_map.py 408 B

123456789101112131415
  1. import json
  2. import sys
  3. def just_do_it(args):
  4. source_root, build_root, out_file, srcs = args[0], args[1], args[2], args[3:]
  5. assert(len(srcs))
  6. result_obj = {}
  7. for src in srcs:
  8. result_obj[src] = {'object': src.replace(source_root, build_root) + '.o'}
  9. with open(out_file, 'w') as of:
  10. of.write(json.dumps(result_obj))
  11. if __name__ == '__main__':
  12. just_do_it(sys.argv[1:])