Skip to content
0.2.0-dev Download ZIP
44 lines ·1.0 KB Raw
1#!/usr/bin/env python
2from misc.utility.scons_hints import *
3
4Import("env")
5Import("env_modules")
6
7env_enet = env_modules.Clone()
8
9# Thirdparty source files
10
11thirdparty_obj = []
12
13if env["builtin_enet"]:
14 thirdparty_dir = "#thirdparty/enet/"
15 thirdparty_sources = [
16 "enet_godot.cpp",
17 "callbacks.c",
18 "compress.c",
19 "host.c",
20 "list.c",
21 "packet.c",
22 "peer.c",
23 "protocol.c",
24 ]
25 thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
26
27 env_enet.Prepend(CPPPATH=[thirdparty_dir])
28 env_enet.Append(CPPDEFINES=["GODOT_ENET"])
29
30 env_thirdparty = env_enet.Clone()
31 env_thirdparty.disable_warnings()
32 env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
33 env.modules_sources += thirdparty_obj
34
35
36# Godot source files
37
38module_obj = []
39
40env_enet.add_source_files(module_obj, "*.cpp")
41env.modules_sources += module_obj
42
43# Needed to force rebuilding the module files when the thirdparty library is updated.
44env.Depends(module_obj, thirdparty_obj)