gen_includes.py 836 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. dest = "../../include/ox/"
  5. def rec(path, local):
  6. for item in os.listdir(path):
  7. if item in ("winnie_alloc", "minizip", "s3e", "curl", "dev_tools", "gl", "android", "emscripten", "ios",
  8. "closure", "pugixml", "json", "text_utils", ):
  9. continue
  10. name = path + item
  11. local_name = local + item
  12. if os.path.isdir(name):
  13. rec(name + "/", local_name + "/")
  14. else:
  15. a, b = os.path.splitext(item)
  16. if a in ("oxygine-include", "oxygine-forwards", "system_data", "cdecode"):
  17. continue
  18. if b == ".h":
  19. c = "#include \"oxygine/%s\"" % (local_name, )
  20. open(dest + a + ".hpp", "w").write(c)
  21. rec("../../oxygine/src/oxygine/", "")