-
Notifications
You must be signed in to change notification settings - Fork 4
/
SConstruct
68 lines (49 loc) · 1.94 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
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python
import os
import sys
env = SConscript("godot-cpp/SConstruct")
# 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
sources = []
# Opus (REQUIRES PRECOMPILE)
if env["platform"] == "windows":
env.Append(CPPPATH=["thirdparty/opus/include"], LIBS=["thirdparty/opus/build/Release/opus.lib"])
env.Append(LINKFLAGS = ['/WX:NO'])
else:
env.Append(CPPPATH=["thirdparty/opus/include"], LIBS=["opus"], LIBPATH="thirdparty/opus/build")
if env["platform"] == "linux":
env.Append(CXXFLAGS = ['-fpermissive'])
# Speex (resampler / jitter buffer)
env.Append(CPPPATH=["thirdparty/speex/include"])
env.Append(CPPDEFINES={"FLOATING_POINT": None, "USE_SMALLFT": None}) # "EXPORT": None ?
if env['arch'] == "amd64" or env['arch'] == "x86_64":
env.Append(CPPDEFINES={"USE_SSE": None, "USE_SSE2": None})
elif env['arch'] == "arm64":
env.Append(CPPDEFINES={"USE_NEON": None})
sources += ["thirdparty/speex/libspeexdsp/resample.c", "thirdparty/speex/libspeexdsp/jitter.c"]
# etc
env.Append(CPPPATH=["thirdparty"])
# OneVOIP Extension
if env["platform"] == "windows":
env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb'
# env.Append(CPPDEFINES={"NDEBUG": None}) # For release builds
env.Append(CPPPATH=["include/"])
sources += Glob("src/*.cpp")
if env["platform"] == "macos":
library = env.SharedLibrary(
"demo_rtc/bin/libonevoip.{}.{}.framework/libonevoip.{}.{}.{}{}".format(
env["platform"], env["target"], env["platform"], env["target"], env["arch"], env["SHLIBSUFFIX"]
),
source=sources,
)
else:
library = env.SharedLibrary(
"demo_rtc/bin/libonevoip{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)
Default(library)