-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSConstruct
30 lines (24 loc) · 1.05 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
#!/usr/bin/env python
import os
import sys
env = SConscript("godot-cpp/SConstruct")
env.PrependENVPath("PATH", os.getenv("PATH"))
env.PrependENVPath("PKG_CONFIG_PATH", os.getenv("PKG_CONFIG_PATH"))
env.Append(CPPPATH=["src/"])
sources = [Glob("src/*.cpp")]
if env["target"] in ["editor", "template_debug"]:
doc_data = env.GodotCPPDocData("gen/doc_data.gen.cpp", source=Glob("doc/*.xml"))
sources.append(doc_data)
if env["platform"] == "linux":
env.Append(LINKFLAGS=['-static-libstdc++'])
# Add libsecret headers to the compilation flow
env.ParseConfig("pkg-config libsecret-1 --cflags --libs")
sources.append(Glob("src/keychain/keychain_linux.cpp"))
elif env["platform"] == "windows":
sources.append(Glob("src/keychain/keychain_win.cpp"))
# Have to be tested, so for now commenting it out
# elif env["platform"] == "macos":
# sources.append(Glob("src/keychain/keychain_mac.cpp"))
libpath = "demo/addons/keyring/bin/keyring{}{}".format(env["suffix"], env["SHLIBSUFFIX"])
library = env.SharedLibrary(libpath, source=sources)
Default(library)