-
Notifications
You must be signed in to change notification settings - Fork 2
/
SConstruct
46 lines (38 loc) · 938 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
38
39
40
41
42
43
44
45
46
# SConstruct
import os
env = Environment()
platform = env['PLATFORM']
# Clang
if platform == 'darwin':
# SCons invokes 'gcc' normally on OS X.
# Usually this is just clang but with options that we don't need.
env['CC'] = 'clang'
env.Append(
CCFLAGS = [
'-Weverything', '-Werror', '-O3', '-g',
],
)
# GCC
if platform == 'posix':
env.Append(
CCFLAGS = [
'-Wall', '-Wextra', '-Wpedantic', '-Werror', '-g',
'-fsanitize=address,undefined',
],
LIBS = ['asan', 'ubsan', 'm', 'bsd'],
)
# MSVC
if platform == 'win32':
env.Append(
CCFLAGS = ['/W4', '/WX', '/Ox'],
CPPDEFINES = ['_CRT_RAND_S'],
)
# for color terminal output when available
if 'TERM' in os.environ:
env['ENV']['TERM'] = os.environ['TERM']
SConscript(
dirs = 'src',
variant_dir = 'dist',
exports = ['env'],
duplicate = False,
)