Skip to content
0.2.0-dev Download ZIP
52 lines ·1.4 KB Raw
1#!/usr/bin/env python
2from misc.utility.scons_hints import *
3
4Import("env")
5Import("env_modules")
6
7env_upnp = env_modules.Clone()
8
9# Thirdparty source files
10
11thirdparty_obj = []
12
13if env["builtin_miniupnpc"] and env["platform"] != "web":
14 thirdparty_dir = "#thirdparty/miniupnpc/"
15 thirdparty_sources = [
16 "igd_desc_parse.c",
17 "miniupnpc.c",
18 "minixml.c",
19 "minisoap.c",
20 "minissdpc.c",
21 "miniwget.c",
22 "upnpcommands.c",
23 "upnpdev.c",
24 "upnpreplyparse.c",
25 "connecthostport.c",
26 "portlistingparse.c",
27 "receivedata.c",
28 "addr_is_reserved.c",
29 ]
30 thirdparty_sources = [thirdparty_dir + "src/" + file for file in thirdparty_sources]
31
32 env_upnp.Prepend(CPPPATH=[thirdparty_dir + "include"])
33 env_upnp.Append(CPPDEFINES=["MINIUPNP_STATICLIB"])
34 if env["platform"] != "windows":
35 env_upnp.Append(CPPDEFINES=["MINIUPNPC_SET_SOCKET_TIMEOUT"])
36
37 env_thirdparty = env_upnp.Clone()
38 env_thirdparty.Prepend(CPPPATH=[thirdparty_dir + "include/miniupnpc"])
39 env_thirdparty.disable_warnings()
40 env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
41 env.modules_sources += thirdparty_obj
42
43
44# Godot source files
45
46module_obj = []
47
48env_upnp.add_source_files(module_obj, "*.cpp")
49env.modules_sources += module_obj
50
51# Needed to force rebuilding the module files when the thirdparty library is updated.
52env.Depends(module_obj, thirdparty_obj)