-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSconstruct
More file actions
55 lines (48 loc) · 1.86 KB
/
Copy pathSconstruct
File metadata and controls
55 lines (48 loc) · 1.86 KB
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
import os
from glob import glob
from SCons import SCons
from SCons.Environment import Environment
env = SConscript("godot-cpp/SConstruct")
def GlobRecursive(pattern, node='.'):
results = []
for f in Glob(str(node) + '/*', source=True):
if type(f) is SCons.Node.FS.Dir:
results += GlobRecursive(pattern, f)
results += Glob(str(node) + '/' + pattern, source=True)
return results
# 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.
env.Append(CPPPATH=["includes", "godot-cpp/include", "godot-cpp/include/godot_cpp", "godot-cpp/", "godot-cpp/gen/include", "godot-cpp/gen/include/godot_cpp", "godot-cpp/gdextension"])
sources = GlobRecursive("*.cpp", "src/")
env.Append(CPPFLAGS=["-DGODOT_EXT=1"])
if env["platform"] == "macos":
library = env.SharedLibrary(
"bin/libcavernfall.{}.{}.framework/libcavernfall.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
source=sources,
)
elif env["platform"] == "ios":
if env["ios_simulator"]:
library = env.StaticLibrary(
"bin/libcavernfall.{}.{}.simulator.a".format(env["platform"], env["target"]),
source=sources,
)
else:
library = env.StaticLibrary(
"bin/libcavernfall.{}.{}.a".format(env["platform"], env["target"]),
source=sources,
)
else:
library = env.SharedLibrary(
"bin/libcavernfall{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library)