SCsub 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. Import("env_modules")
  5. env_gdscript = env_modules.Clone()
  6. env_gdscript.add_source_files(env.modules_sources, "*.cpp")
  7. if env.editor_build:
  8. env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp")
  9. SConscript("editor/script_templates/SCsub")
  10. # Those two modules are required for the language server protocol
  11. if env["module_jsonrpc_enabled"] and env["module_websocket_enabled"]:
  12. env_gdscript.add_source_files(env.modules_sources, "./language_server/*.cpp")
  13. else:
  14. # Using a define in the disabled case, to avoid having an extra define
  15. # in regular builds where all modules are enabled.
  16. env_gdscript.Append(CPPDEFINES=["GDSCRIPT_NO_LSP"])
  17. # Also needed in main env to unexpose --lsp-port option.
  18. env.Append(CPPDEFINES=["GDSCRIPT_NO_LSP"])
  19. if env["tests"]:
  20. env_gdscript.Append(CPPDEFINES=["TESTS_ENABLED"])
  21. env_gdscript.add_source_files(env.modules_sources, "./tests/*.cpp")