forked from SuperAdventureGameInC/SuperAdventureGameInC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
43 lines (35 loc) · 1.43 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
import os
import sys
# This creates an environment to compile and link with.
# Using 'ENV = os.environ' tells SCons to use the paths in your current system to find tools like your compiler and linker.
environment = Environment(ENV = os.environ)
if os.name == "posix":
environment.Append(CFLAGS = " -g -Werror ", LINKFLAGS = " -g ")
turbojson = SConscript(dirs=["TurboJSON"], exports=["environment"])
environment.Append(CPPPATH = [os.getcwd(), os.path.join(os.getcwd(), "include")], LIBPATH = os.path.join(os.getcwd(), "lib"))
def EnabledString(that):
if that:
return "enabled"
else:
return "disabled"
def EnableableOption(name, default):
AddOption("--enable-" + name,
action="store_true", dest="en_" + name, default=False,
help="Enables " + name)
AddOption("--disable-" + name,
action="store_true", dest="dis_" + name, default=False,
help="Disables " + name)
enable = GetOption("en_" + name)
disable = GetOption("dis_" + name)
if enable and disable:
print("Warning: Both enable and disable " + name + " specified.")
return default
if disable:
return False
elif enable:
return True
else:
return default
use_audio = EnableableOption("audio", not (("win" in sys.platform) or ("msys" in sys.platform)))
# SConscript executes the build script specified.
SConscript(dirs=["src"], exports=["environment", "turbojson", "use_audio"])