Files
engine/modules/websocket/SCsub
T

48 lines
1.2 KiB
Python
Raw Normal View History

2017-12-21 03:13:23 +01:00
#!/usr/bin/env python
Import("env")
Import("env_modules")
2017-12-21 03:13:23 +01:00
2019-06-24 15:46:24 +02:00
env_ws = env_modules.Clone()
2017-12-21 03:13:23 +01:00
thirdparty_obj = []
if env["platform"] == "javascript":
# Our JavaScript/C++ interface.
env.AddJSLibraries(["library_godot_websocket.js"])
elif env["builtin_wslay"]:
# Thirdparty source files
thirdparty_dir = "#thirdparty/wslay/"
thirdparty_sources = [
2019-06-24 15:46:24 +02:00
"wslay_net.c",
"wslay_event.c",
"wslay_queue.c",
"wslay_frame.c",
]
thirdparty_sources = [thirdparty_dir + s for s in thirdparty_sources]
2021-11-19 13:28:01 +01:00
env_ws.Prepend(CPPPATH=[thirdparty_dir])
2019-07-01 18:14:26 +02:00
env_ws.Append(CPPDEFINES=["HAVE_CONFIG_H"])
2019-06-24 15:46:24 +02:00
if env["platform"] == "windows" or env["platform"] == "uwp":
2019-07-01 18:14:26 +02:00
env_ws.Append(CPPDEFINES=["HAVE_WINSOCK2_H"])
2019-06-24 15:46:24 +02:00
else:
2019-07-01 18:14:26 +02:00
env_ws.Append(CPPDEFINES=["HAVE_NETINET_IN_H"])
2019-06-24 15:46:24 +02:00
env_thirdparty = env_ws.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
# Godot source files
module_obj = []
env_ws.add_source_files(module_obj, "*.cpp")
env.modules_sources += module_obj
# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)