This repository has been archived by the owner on Oct 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
SConstruct
46 lines (39 loc) · 1.3 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
#!/usr/bin/env python
import os
import sys
env = SConscript("godot-cpp/SConstruct")
## Libs
if env["dev_build"]:
lib_folder = "src/rapier2d-wrapper/target/debug"
else:
lib_folder = "src/rapier2d-wrapper/target/release"
if env["platform"] == "windows":
lib_file = "rapier2d_wrapper{}"
lib = lib_file.format(env["LIBSUFFIX"])
else:
lib_file = "librapier2d_wrapper{}"
lib = lib_file.format(env["LIBSUFFIX"])
env.Append(LIBPATH=[lib_folder])
env.Append(LIBS=[lib])
## Sources
env.Append(CPPPATH=["src/"])
sources = [Glob("src/*.cpp"),Glob("src/bodies/*.cpp"),Glob("src/joints/*.cpp"),Glob("src/servers/*.cpp"),Glob("src/shapes/*.cpp"),Glob("src/spaces/*.cpp")]
if env["platform"] == "windows":
env.Append(CPPDEFINES="WINDOWS_ENABLED")
if env["precision"] == "double":
env.Append(CPPDEFINES=["REAL_T_IS_DOUBLE"])
else:
env.Append(CPPDEFINES=["REAL_T_IS_FLOAT"])
if env["platform"] == "macos":
library = env.SharedLibrary(
"bin/addons/godot-rapier2d/bin/libphysics_server_rapier2d.{}.{}.framework/libphysics_server_rapier2d.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
source=sources,
)
else:
library = env.SharedLibrary(
"bin/addons/godot-rapier2d/bin/libphysics_server_rapier2d{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library)