SCsub 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env python
  2. Import("env")
  3. from platform_methods import run_in_subprocess
  4. import main_builders
  5. env.main_sources = []
  6. env.add_source_files(env.main_sources, "*.cpp")
  7. # Order matters here. Higher index controller database files write on top of lower index database files.
  8. controller_databases = ["#main/gamecontrollerdb.txt", "#main/godotcontrollerdb.txt"]
  9. env.Depends("#main/default_controller_mappings.gen.cpp", controller_databases)
  10. env.CommandNoCache(
  11. "#main/default_controller_mappings.gen.cpp",
  12. controller_databases,
  13. run_in_subprocess(main_builders.make_default_controller_mappings),
  14. )
  15. # Don't warn about duplicate entry here, we need it registered manually for first build,
  16. # even if later builds will pick it up twice due to above *.cpp globbing.
  17. env.add_source_files(env.main_sources, "#main/default_controller_mappings.gen.cpp", warn_duplicates=False)
  18. env.Depends("#main/splash.gen.h", "#main/splash.png")
  19. env.CommandNoCache("#main/splash.gen.h", "#main/splash.png", run_in_subprocess(main_builders.make_splash))
  20. env.Depends("#main/splash_editor.gen.h", "#main/splash_editor.png")
  21. env.CommandNoCache(
  22. "#main/splash_editor.gen.h", "#main/splash_editor.png", run_in_subprocess(main_builders.make_splash_editor)
  23. )
  24. env.Depends("#main/app_icon.gen.h", "#main/app_icon.png")
  25. env.CommandNoCache("#main/app_icon.gen.h", "#main/app_icon.png", run_in_subprocess(main_builders.make_app_icon))
  26. if env["tools"]:
  27. SConscript("tests/SCsub")
  28. lib = env.add_library("main", env.main_sources)
  29. env.Prepend(LIBS=[lib])