-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
66 lines (52 loc) · 1.71 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
63
64
65
66
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2012-2020 Association Prologin <[email protected]>
import glob
import os.path
from wafgenerator import generator_player_install
def options(opt):
pass
def configure(cfg):
pass
def build(bld):
bld.shlib(
source='''
src/action-ack.cc
src/action-attack.cc
src/action-construct.cc
src/action-create.cc
src/action-delete.cc
src/action-move.cc
src/action-shoot.cc
src/api.cc
src/cell.cc
src/dumper.cc
src/entry.cc
src/game-state.cc
src/interface.cc
src/map.cc
src/rules.cc
''',
defines=['MODULE_COLOR=ANSI_COL_BROWN', 'MODULE_NAME="rules"'],
target='prologin2014',
use=['stechec2'],
)
abs_pattern = os.path.join(bld.path.abspath(), 'src/tests/test-*.cc')
for test_src in glob.glob(abs_pattern):
test_name = os.path.split(test_src)[-1]
test_name = test_name[len("test-"):-(len(".cc"))]
# Waf requires a relative path for the source
src_relpath = os.path.relpath(test_src, bld.path.abspath())
bld.program(
features='gtest',
source=src_relpath,
target='prologin2014-test-{}'.format(test_name),
use=['prologin2014', 'stechec2-utils'],
includes=['.'],
defines=['MODULE_COLOR=ANSI_COL_PURPLE',
'MODULE_NAME="prologin2014"'],
)
bld.install_files('${PREFIX}/share/stechec2/prologin2014', [
'prologin2014.yml',
])
generator_player_install(bld, 'prologin2014')