generated from godotengine/godot-cpp-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSConstruct
55 lines (48 loc) · 1.27 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
#!/usr/bin/env python
libname = "libgdmotioncontrols"
env = SConscript("godot-cpp/SConstruct")
env.Append(LIBPATH=["sdl/lib"])
env.Append(CPPPATH=["src/", "sdl/include/"])
if env["platform"] == "windows" and (env['CC'] == 'gcc' or env['CXX'] == 'g++'):
env.Append(LINKFLAGS=["-Wl,--dynamicbase","-Wl,--nxcompat"])
env.Append(CXXFLAGS =["-mwindows"])
env.Append(
LIBS=[
"libSDL2",
"libSDL2main",
"setupapi",
"winmm",
"user32",
"gdi32",
"dinput8",
"dxguid",
"dxerr8",
"imm32",
"ole32",
"version",
"uuid",
"m",
"oleaut32",
"shell32"
]
)
elif env['CC'] == 'cl':
env.Append(
LIBS=[
"SDL2",
"SDL2main",
]
)
sources = Glob("src/*.cpp")
if env["platform"] == "macos":
platlibname = "{}.{}.{}".format(libname, env["platform"], env["target"])
library = env.SharedLibrary(
"bin/{}.framework/{}".format(platlibname, platlibname),
source=sources,
)
else:
library = env.SharedLibrary(
"bin/{}{}{}".format(libname, env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library)