-
Notifications
You must be signed in to change notification settings - Fork 1
/
wscript
62 lines (44 loc) · 1.43 KB
/
wscript
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
#!/usr/bin/env python
top = "."
build = "build"
import os
import sys
import subprocess
from waflib import TaskGen
@TaskGen.extension(".m")
def m_hook(self, node):
return self.create_compiled_task("c", node)
@TaskGen.extension(".mm")
def mm_hook(self, node):
return self.create_compiled_task("cxx", node)
ENGINE_SRC = "src"
BUILD_DIR = "build"
DEPS_DIR = os.path.abspath("deps")
def options(ctx):
ctx.load("compiler_cxx")
ctx.load("compiler_c")
def configure(ctx):
ctx.load("compiler_cxx")
ctx.load("compiler_c")
ctx.check(features="c cxx", cflags=["-Wall", "-Werror"])
ctx.env.DEFINES = []
if sys.platform == "darwin":
ctx.env.append_value("DEFINES", "USE_KQUEUE_EVENTS=1")
ctx.env.append_value("DEFINES", "USE_PTHREAD_THREADS=1")
def build(ctx):
ctx.read_stlib("lua", [os.path.join(DEPS_DIR, "lua-5.2.1", "lua-5.2.1", "src")])
incls = [ENGINE_SRC]
incls += [os.path.join(DEPS_DIR, "lua-5.2.1", "lua-5.2.1", "src")]
libs = ["lua"]
src = ctx.path.ant_glob("%s/**/*.cpp" % ENGINE_SRC, excl="%s/platform/**/*.cpp" % ENGINE_SRC)
if sys.platform == "darwin":
src += ctx.path.ant_glob("%s/platform/kqueue/*.cpp" % ENGINE_SRC)
ctx.program(
features = "c cxx",
source = src,
target = "rocketdemo",
defines = ctx.env.DEFINES,
includes = incls,
use = libs,
mac_app = True
)