-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSConstruct
38 lines (23 loc) · 880 Bytes
/
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
#!python
import api_generator
ARGUMENTS["custom_api_file"] = "./custom_api.json"
env = SConscript("godot-cpp/SConstruct")
env.Tool("compilation_db")
compile_commands = env.CompilationDatabase("compile_commands.json")
Alias('compile_commands', compile_commands)
library_name = "libunixsocket"
platform = env["platform"]
if not platform in ("linux", "macos"):
print("No valid target platform selected.")
quit()
env.Append(CPPPATH=["src"])
sources = ["src/lib.cpp", "src/stream_peer_unix.cpp"]
target_name = env["target"]
if target_name != "editor":
target_name = "release" if target_name == "template_release" else "debug"
arch = env["arch"]
suffix = f".{platform}.{target_name}.{arch}"
shlib_suffix = env["SHLIBSUFFIX"]
library = env.SharedLibrary(f"bin/{library_name}{suffix}{shlib_suffix}",
source=sources)
Default(library)