-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
SConstruct
69 lines (58 loc) · 1.75 KB
/
SConstruct
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
#!python
import os
env = SConscript("src/lib/godot-cpp/SConstruct")
if env["platform"] == "macos":
discord_library = "libdiscord_game_sdk.dylib"
discord_library_second = ""
libexportfolder = "/macos/"
elif env["platform"] in ("linuxbsd", "linux"):
discord_library = "libdiscord_game_sdk.so"
discord_library_second = ""
libexportfolder = "/linux/"
elif env["platform"] == "windows":
discord_library = "discord_game_sdk.dll"
discord_library_second = "discord_game_sdk_x86.dll"
libexportfolder = "/windows/"
if env["target"] == "template_debug":
debugsuffix = "_debug"
else:
debugsuffix = ""
if env.get("arch") == "arm64":
armsuffix = "_arm64"
else:
armsuffix = ""
env.Append(LIBPATH=["src/lib/discord_game_sdk/bin/"])
sources = Glob("src/lib/discord_game_sdk/cpp/*.cpp")
env.Append(CPPPATH=["src/lib/discord_game_sdk/cpp/"])
env.Append(LIBS=["discord_game_sdk"])
env.Append(CPPPATH=["src/"])
sources += Glob("src/*.cpp")
env.Append(CPPDEFINES=["HOT_RELOAD_ENABLED"])
library = env.SharedLibrary(
target="project/addons/discord-rpc-gd/bin/"
+ libexportfolder
+ "discord_game_sdk_binding"
+ armsuffix
+ debugsuffix,
source=sources,
)
env.Depends(
library,
Command(
"project/addons/discord-rpc-gd/bin/" + libexportfolder + discord_library,
"src/lib/discord_game_sdk/bin/" + discord_library,
Copy("$TARGET", "$SOURCE"),
),
)
if discord_library_second != "":
env.Depends(
library,
Command(
"project/addons/discord-rpc-gd/bin/"
+ libexportfolder
+ discord_library_second,
"src/lib/discord_game_sdk/bin/" + discord_library_second,
Copy("$TARGET", "$SOURCE"),
),
)
Default(library)