-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add waf buildscript, a reference waf build, that can be copied to any…
… FWGS project, make env names for subproject more complex to avoid collision, add subproject test
- Loading branch information
Showing
8 changed files
with
293 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build/* | ||
.waf* | ||
.lock* | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
TOOLS="msvc,clang_compilation_database" | ||
PRELUDE=$'\tsys.path.insert(0, \'scripts/waifulib\')' | ||
|
||
pushd wafsrc | ||
./waf-light "--tools=$TOOLS" "--prelude=$PRELUDE" | ||
mv waf ../ | ||
popd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /usr/bin/env python | ||
# encoding: utf-8 | ||
# a1batross, 2019 | ||
|
||
def options(opt): | ||
opt.add_option('--foo_test', action='store_true', default=True, dest='foo_test') | ||
|
||
def configure(conf): | ||
conf.env.SUBDIRS_FOO = 'foo' | ||
|
||
# check options() was called | ||
if not conf.options.foo_test: | ||
raise Exception('TEST FAILED') | ||
|
||
# check if we really derived environment | ||
if conf.env.SUBDIRS_ROOT != 'meow': | ||
raise Exception('TEST FAILED') | ||
|
||
def build(bld): | ||
# check if environment was derived correctly | ||
if bld.env.SUBDIRS_ROOT != 'meow': | ||
raise Exception('TEST FAILED') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#! /usr/bin/env python | ||
# encoding: utf-8 | ||
# a1batross, 2019 | ||
|
||
def options(opt): | ||
opt.add_subproject('foo') | ||
|
||
def configure(conf): | ||
conf.env.SUBDIRS_ROOT = 'meow' | ||
conf.add_subproject('foo') | ||
|
||
# check that we're still using our enviroment | ||
if 'SUBDIRS_FOO' in conf.env: | ||
raise Exception('TEST FAILED') | ||
|
||
def build(bld): | ||
bld.add_subproject('foo') | ||
|
||
# check that 'foo' env isn't derived | ||
if 'SUBDIRS_FOO' in bld.env: | ||
raise Exception('TEST FAILED') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env python | ||
# encoding: utf-8 | ||
# a1batross, 2019 | ||
|
||
def options(opt): | ||
opt.add_subproject('subdirs') | ||
pass | ||
|
||
def configure(conf): | ||
conf.add_subproject('subdirs') | ||
pass | ||
|
||
def build(bld): | ||
bld.add_subproject('subdirs') | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /usr/bin/env python | ||
# encoding: utf-8 | ||
# a1batross, mittorn, 2018 | ||
|
||
from __future__ import print_function | ||
|
||
VERSION = '1.0' | ||
APPNAME = 'waifu-tests' | ||
top = '.' | ||
|
||
def subdirs(): | ||
return map(lambda x: x.name, SUBDIRS) | ||
|
||
def options(opt): | ||
opt.load('subproject') | ||
opt.add_subproject('tests') | ||
pass | ||
|
||
def configure(conf): | ||
conf.add_subproject('tests') | ||
pass | ||
|
||
def build(bld): | ||
bld.add_subproject('tests') | ||
pass |