build_mn_files.py 994 B

1234567891011121314151617181920212223242526272829
  1. from os.path import basename, splitext
  2. def on_build_mns_files(unit, *args):
  3. files = []
  4. name = ''
  5. ranking_suffix = ''
  6. check = ''
  7. index = 0
  8. fml_unused_tool = ''
  9. while index < len(args):
  10. if args[index] == 'NAME':
  11. index += 1
  12. name = args[index]
  13. elif args[index] == 'RANKING_SUFFIX':
  14. index += 1
  15. ranking_suffix = args[index]
  16. elif args[index] == 'CHECK':
  17. check = 'CHECK'
  18. fml_unused_tool = unit.get('FML_UNUSED_TOOL') or '$FML_UNUSED_TOOL'
  19. else:
  20. files.append(args[index])
  21. index += 1
  22. for filename in files:
  23. file_basename, _ = splitext(basename(filename))
  24. asmdataname = "staticMn{0}{1}Ptr".format(ranking_suffix, file_basename)
  25. output_name = 'mn.staticMn{0}{1}Ptr.cpp'.format(ranking_suffix, file_basename)
  26. unit.on_build_mns_file([filename, name, output_name, ranking_suffix, check, fml_unused_tool, asmdataname])