2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-22 17:29:27 +01:00
This commit is contained in:
Thomas Nagy 2012-04-17 21:53:01 +02:00
parent 7515dab30e
commit 9f7330b745
8 changed files with 74 additions and 0 deletions

View File

@ -13,6 +13,7 @@ NEW IN WAF 1.7.0
* Extended bld.subst() to perform simple copies to the build directory
* Removed the default DLL_EXPORT define on gcc/g++ shared libraries
* Calling ctx.root.ant_glob(abspath) will return results #1135
* New case-insentive option for ant_glob #1148
NEW IN WAF 1.6.11
-----------------

View File

@ -0,0 +1 @@
int k = 123;

View File

@ -0,0 +1,6 @@
#include "a.h"
#include "b.h"
int main() {
return 0;
}

View File

@ -0,0 +1,14 @@
#! /usr/bin/env python
def write_header(tsk):
tsk.outputs[0].write('int abc = 423;')
bld(rule=write_header, target='b.h', ext_out=['.h'])
bld.program(
source = 'main.c',
includes = '. ..',
cflags = ['-O3'],
defines = ['foo=bar'],
target = 'myprogram',
use = 'M')

View File

@ -0,0 +1,4 @@
int main()
{
return 0;
}

View File

@ -0,0 +1,2 @@
int k = 3;

View File

@ -0,0 +1,12 @@
#! /usr/bin/env python
bld.stlib(
source = 'test_staticlib.c',
target = 'my_static_lib')
bld.program(
source = 'main.c',
target = 'test_static_link',
includes = '.',
use = 'my_static_lib')

34
playground/lint/wscript Normal file
View File

@ -0,0 +1,34 @@
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2012 (ita)
# the following two variables are used by the target "waf dist"
VERSION='0.0.1'
APPNAME='cc_test'
top = '.'
def options(opt):
opt.load('compiler_c')
def configure(conf):
conf.load('compiler_c')
conf.find_program('splint', var='LINT')
def build(bld):
bld.env.DEFINES=['WAF=1']
bld.recurse('program stlib')
from waflib.TaskGen import feature, after_method
@feature('c')
@after_method('process_source')
def add_files_to_lint(self):
for x in self.compiled_tasks:
self.create_task('lint', x.inputs[0])
from waflib import Task
class lint(Task.Task):
run_str = '${LINT} ${CPPPATH_ST:INCPATHS} ${SRC}'
ext_in = ['.h'] # guess why this line..
before = ['c']