0.2.0-dev Download ZIP
44 lines ·1.0 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_enet = env_modules.Clone() |
| 8 | |
| 9 | # Thirdparty source files |
| 10 | |
| 11 | thirdparty_obj = [] |
| 12 | |
| 13 | if 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 | |
| 38 | module_obj = [] |
| 39 | |
| 40 | env_enet.add_source_files(module_obj, "*.cpp") |
| 41 | env.modules_sources += module_obj |
| 42 | |
| 43 | # Needed to force rebuilding the module files when the thirdparty library is updated. |
| 44 | env.Depends(module_obj, thirdparty_obj) |