SCsub 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env python
  2. Import("env")
  3. import os
  4. from platform_methods import run_in_subprocess
  5. import platform_windows_builders
  6. common_win = [
  7. "godot_windows.cpp",
  8. "crash_handler_windows.cpp",
  9. "os_windows.cpp",
  10. "display_server_windows.cpp",
  11. "key_mapping_windows.cpp",
  12. "joypad_windows.cpp",
  13. "tts_windows.cpp",
  14. "windows_terminal_logger.cpp",
  15. "vulkan_context_win.cpp",
  16. "gl_manager_windows.cpp",
  17. ]
  18. common_win_wrap = [
  19. "console_wrapper_windows.cpp",
  20. ]
  21. res_file = "godot_res.rc"
  22. res_target = "godot_res" + env["OBJSUFFIX"]
  23. res_obj = env.RES(res_target, res_file)
  24. prog = env.add_program("#bin/godot", common_win + res_obj, PROGSUFFIX=env["PROGSUFFIX"])
  25. # Build console wrapper app.
  26. if env["windows_subsystem"] == "gui":
  27. env_wrap = env.Clone()
  28. res_wrap_file = "godot_res_wrap.rc"
  29. res_wrap_target = "godot_res_wrap" + env["OBJSUFFIX"]
  30. res_wrap_obj = env_wrap.RES(res_wrap_target, res_wrap_file)
  31. if env.msvc:
  32. env_wrap.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"])
  33. env_wrap.Append(LINKFLAGS=["version.lib"])
  34. else:
  35. env_wrap.Append(LINKFLAGS=["-Wl,--subsystem,console"])
  36. env_wrap.Append(LIBS=["version"])
  37. prog_wrap = env_wrap.add_program("#bin/godot", common_win_wrap + res_wrap_obj, PROGSUFFIX=env["PROGSUFFIX_WRAP"])
  38. # Microsoft Visual Studio Project Generation
  39. if env["vsproj"]:
  40. env.vs_srcs += ["platform/windows/" + res_file]
  41. env.vs_srcs += ["platform/windows/godot.natvis"]
  42. for x in common_win:
  43. env.vs_srcs += ["platform/windows/" + str(x)]
  44. if env["windows_subsystem"] == "gui":
  45. for x in common_win_wrap:
  46. env.vs_srcs += ["platform/windows/" + str(x)]
  47. if not os.getenv("VCINSTALLDIR"):
  48. if env["debug_symbols"] and env["separate_debug_symbols"]:
  49. env.AddPostAction(prog, run_in_subprocess(platform_windows_builders.make_debug_mingw))
  50. if env["windows_subsystem"] == "gui":
  51. env.AddPostAction(prog_wrap, run_in_subprocess(platform_windows_builders.make_debug_mingw))