0.2.0-dev Download ZIP
30 lines ·1.1 KB Raw
| 1 | #!/usr/bin/env python |
| 2 | from misc.utility.scons_hints import * |
| 3 | |
| 4 | Import("env") |
| 5 | Import("env_modules") |
| 6 | |
| 7 | env_gdscript = env_modules.Clone() |
| 8 | |
| 9 | env_gdscript.add_source_files(env.modules_sources, "*.cpp") |
| 10 | |
| 11 | if env.editor_build: |
| 12 | env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp") |
| 13 | |
| 14 | SConscript("editor/script_templates/SCsub") |
| 15 | |
| 16 | # Those two modules are required for the language server protocol |
| 17 | if env["module_jsonrpc_enabled"] and env["module_websocket_enabled"]: |
| 18 | env_gdscript.add_source_files(env.modules_sources, "./language_server/*.cpp") |
| 19 | else: |
| 20 | # Using a define in the disabled case, to avoid having an extra define |
| 21 | # in regular builds where all modules are enabled. |
| 22 | env_gdscript.Append(CPPDEFINES=["GDSCRIPT_NO_LSP"]) |
| 23 | # Also needed in main env to unexpose --lsp-port option. |
| 24 | env.Append(CPPDEFINES=["GDSCRIPT_NO_LSP"]) |
| 25 | |
| 26 | |
| 27 | if env["tests"]: |
| 28 | # TODO: Handle test creation magic without needing to pass macro. |
| 29 | env_gdscript.Append(CPPDEFINES=["TESTS_ENABLED"]) |
| 30 | env_gdscript.add_source_files(env.modules_sources, "./tests/*.cpp") |