| 1 |
|
| 2 |
from misc.utility.scons_hints import * |
| 3 |
|
| 4 |
Import("env") |
| 5 |
Import("env_modules") |
| 6 |
|
| 7 |
env_ws = env_modules.Clone() |
| 8 |
|
| 9 |
thirdparty_obj = [] |
| 10 |
|
| 11 |
if env["platform"] == "web": |
| 12 |
|
| 13 |
env.AddJSLibraries(["library_godot_websocket.js"]) |
| 14 |
|
| 15 |
elif env["builtin_wslay"]: |
| 16 |
|
| 17 |
thirdparty_dir = "#thirdparty/wslay/" |
| 18 |
thirdparty_sources = [ |
| 19 |
"wslay_net.c", |
| 20 |
"wslay_event.c", |
| 21 |
"wslay_queue.c", |
| 22 |
"wslay_frame.c", |
| 23 |
] |
| 24 |
thirdparty_sources = [thirdparty_dir + s for s in thirdparty_sources] |
| 25 |
|
| 26 |
env_ws.Prepend(CPPPATH=[thirdparty_dir]) |
| 27 |
env_ws.Append(CPPDEFINES=["HAVE_CONFIG_H"]) |
| 28 |
|
| 29 |
if env["platform"] == "windows": |
| 30 |
env_ws.Append(CPPDEFINES=["HAVE_WINSOCK2_H"]) |
| 31 |
else: |
| 32 |
env_ws.Append(CPPDEFINES=["HAVE_NETINET_IN_H"]) |
| 33 |
|
| 34 |
env_thirdparty = env_ws.Clone() |
| 35 |
env_thirdparty.disable_warnings() |
| 36 |
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources) |
| 37 |
env.modules_sources += thirdparty_obj |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
module_obj = [] |
| 43 |
|
| 44 |
env_ws.add_source_files(module_obj, "*.cpp") |
| 45 |
if env.editor_build: |
| 46 |
env_ws.add_source_files(module_obj, "editor/*.cpp") |
| 47 |
env.modules_sources += module_obj |
| 48 |
|
| 49 |
|
| 50 |
env.Depends(module_obj, thirdparty_obj) |