SCsub 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_native.cpp",
  17. "gl_manager_windows_angle.cpp",
  18. "wgl_detect_version.cpp",
  19. ]
  20. common_win_wrap = [
  21. "console_wrapper_windows.cpp",
  22. ]
  23. res_file = "godot_res.rc"
  24. res_target = "godot_res" + env["OBJSUFFIX"]
  25. res_obj = env.RES(res_target, res_file)
  26. prog = env.add_program("#bin/godot", common_win + res_obj, PROGSUFFIX=env["PROGSUFFIX"])
  27. # Build console wrapper app.
  28. if env["windows_subsystem"] == "gui":
  29. env_wrap = env.Clone()
  30. res_wrap_file = "godot_res_wrap.rc"
  31. res_wrap_target = "godot_res_wrap" + env["OBJSUFFIX"]
  32. res_wrap_obj = env_wrap.RES(res_wrap_target, res_wrap_file)
  33. if env.msvc:
  34. env_wrap.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"])
  35. env_wrap.Append(LINKFLAGS=["version.lib"])
  36. else:
  37. env_wrap.Append(LINKFLAGS=["-Wl,--subsystem,console"])
  38. env_wrap.Append(LIBS=["version"])
  39. prog_wrap = env_wrap.add_program("#bin/godot", common_win_wrap + res_wrap_obj, PROGSUFFIX=env["PROGSUFFIX_WRAP"])
  40. env_wrap.Depends(prog_wrap, prog)
  41. # Microsoft Visual Studio Project Generation
  42. if env["vsproj"]:
  43. env.vs_srcs += ["platform/windows/" + res_file]
  44. env.vs_srcs += ["platform/windows/godot.natvis"]
  45. for x in common_win:
  46. env.vs_srcs += ["platform/windows/" + str(x)]
  47. if env["windows_subsystem"] == "gui":
  48. for x in common_win_wrap:
  49. env.vs_srcs += ["platform/windows/" + str(x)]
  50. if not os.getenv("VCINSTALLDIR"):
  51. if env["debug_symbols"] and env["separate_debug_symbols"]:
  52. env.AddPostAction(prog, run_in_subprocess(platform_windows_builders.make_debug_mingw))
  53. if env["windows_subsystem"] == "gui":
  54. env.AddPostAction(prog_wrap, run_in_subprocess(platform_windows_builders.make_debug_mingw))