-
Notifications
You must be signed in to change notification settings - Fork 5
/
SCsub
74 lines (65 loc) · 2.32 KB
/
SCsub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# SCsub
import platform as p
Import('env')
sources = [
"register_types.cpp",
"godotcord.cpp",
"godotcord_network_peer.cpp",
"godotcord_achievement_manager.cpp",
"godotcord_activity_manager.cpp",
"godotcord_lobby_manager.cpp",
"godotcord_image_manager.cpp",
"godotcord_overlay_manager.cpp",
"godotcord_relationship_manager.cpp",
"godotcord_storage_manager.cpp",
"godotcord_store_manager.cpp",
"godotcord_user_manager.cpp",
"godotcord_voice_manager.cpp",
"discord-files/achievement_manager.cpp",
"discord-files/activity_manager.cpp",
"discord-files/application_manager.cpp",
"discord-files/core.cpp",
"discord-files/image_manager.cpp",
"discord-files/lobby_manager.cpp",
"discord-files/network_manager.cpp",
"discord-files/overlay_manager.cpp",
"discord-files/relationship_manager.cpp",
"discord-files/storage_manager.cpp",
"discord-files/store_manager.cpp",
"discord-files/types.cpp",
"discord-files/user_manager.cpp",
"discord-files/voice_manager.cpp"
]
def detect_platform_for_server(platform_string):
switcher = {
'Linux': 'x11',
'Darwin': 'osx',
'Windows': 'windows'
}
return switcher.get(platform_string, "Invalid platform")
platform = env["platform"]
def set_linker_vars():
if platform == "windows":
env.add_source_files(env.modules_sources, sources)
env.Append(LIBPATH=['#modules/godotcord/libpath'])
if env["bits"] == "64":
env.Append(LINKFLAGS=['discord_game_sdk.dll.lib'])
elif env["bits"] == "32":
env.Append(LINKFLAGS=['discord_game_sdk.32.dll.lib'])
elif(platform == "x11"):
if env["bits"] == "64":
env.add_source_files(env.modules_sources, sources)
env.Append(LIBPATH=['#modules/godotcord/libpath'])
env.Append(RPATH=[Literal("\$$ORIGIN:.")])
env.Append(LIBS=['discord_game_sdk'])
elif(platform == "osx"):
env.add_source_files(env.modules_sources, sources)
env.Append(LIBPATH=['#modules/godotcord/libpath'])
env.Append(LIBS=['discord_game_sdk'])
env.Append(LINKFLAGS=["-Wl,-rpath,@executable_path"])
if env["platform"] != "server":
set_linker_vars()
else:
print(p.system())
platform = detect_platform_for_server(p.system())
set_linker_vars()