-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
57 lines (47 loc) · 1.92 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
#!/usr/bin/env python
import os
import sys
env = SConscript("godot-cpp/SConstruct")
# For reference:
# - CCFLAGS are compilation flags shared between C and C++
# - CFLAGS are for C-specific compilation flags
# - CXXFLAGS are for C++-specific compilation flags
# - CPPFLAGS are for pre-processor flags
# - CPPDEFINES are for pre-processor defines
# - LINKFLAGS are for linking flags
# tweak this if you want to use different folders, or more folders, to store your source code in.
project_name = "godouse"
gd_extensions_folder = "godouse-cpp-gdextensions"
is_desktop = env["platform"] == "macos" or env["platform"] == "windows" or env["platform"] == "linux"
env.Append(CPPPATH=[
"{}/".format(gd_extensions_folder)
])
# Add files to include in the compilation
sources : list[str] = Glob("{}/*.cpp".format(gd_extensions_folder))
sources.append(Glob("{}/XInputSimulator/*.cpp".format(gd_extensions_folder)))
if is_desktop:
env["CPPPATH"].append("{}/traypp/include/".format(gd_extensions_folder))
sources.append(Glob("{}/traypp/src/**/*.cpp".format(gd_extensions_folder)))
sources.append(Glob("{}/traypp/src/**/**/*.cpp".format(gd_extensions_folder)))
if env["platform"] == "macos":
library = env.SharedLibrary(
"bin/{}.{}.{}.framework/{}.{}.{}".format(
project_name,env["platform"], env["target"],project_name, env["platform"], env["target"]
),
source=sources,
)
elif env["platform"] == "windows":
# Include windows library
env.Append(LIBS=["User32","Shell32"])
library = env.SharedLibrary(
"bin/{}{}{}".format(project_name,env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
elif env["platform"] == "android":
env.Append(CPPDEFINES=["__EXCLUDE_TRAY_SYSTEM__"])
lib_name = "lib_{}".format(project_name)
library = env.SharedLibrary(
"bin/{}{}{}".format(lib_name,env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library)